Synchronization in a multi-tile, multi-chip processing arrangement

ABSTRACT

A method of operating a system comprising multiple processor tiles divided into a plurality of domains wherein within each domain the tiles are connected to one another via a respective instance of a time-deterministic interconnect and between domains the tiles are connected to one another via a non-time-deterministic interconnect. The method comprises: performing a compute stage, then performing a respective internal barrier synchronization within each domain, then performing an internal exchange phase within each domain, then performing an external barrier synchronization to synchronize between different domains, then performing an external exchange phase between the domains.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the priority benefit the priority benefit under35 U.S.C. § 119 of United Kingdom Patent Application No. 1717294.1,filed Oct. 20, 2017, the entire contents of which are incorporatedherein by reference.

TECHNICAL FIELD

The present disclosure relates to synchronizing the workloads ofmultiple different tiles in a processor comprising a multi-tileprocessing arrangement, each tile comprising its own processing unit andmemory. Particularly, the disclosure relates to bulk synchronousparallel (BSP) communication schemes whereby each of a group of tilesmust complete a compute phase before any of the tiles in the group canproceed to an exchange phase.

BACKGROUND

A multi-threaded processor is a processor which is capable of executingmultiple program threads alongside one another. The processor maycomprise some hardware that is common to the multiple different threads(e.g. a common instruction memory, data memory and/or execution unit);but to support the multi-threading, the processor also comprises somededicated hardware specific to each thread.

The dedicated hardware comprises at least a respective context registerfile for each of the number of threads that can be executed at once. A“context”, when talking about multi-threaded processors, refers to theprogram state of a respective on of the threads being executed alongsideone another (e.g. program counter value, status and current operandvalues). The context register file refers to the respective collectionof registers for representing this program state of the respectivethread. Registers in a register file are distinct from general purposememory in that register addresses are fixed as bits in instructionwords, whereas memory addresses can be computed by executinginstructions. The registers of a given context typically comprise arespective program counter for the respective thread, and a respectiveset of operand registers for temporarily holding the data acted upon andoutput by the respective thread during the computations performed bythat thread. Each context may also have a respective status register forstoring a status of the respective thread (e.g. whether it is paused orrunning). Thus each of the currently running threads has its ownseparate program counter, and optionally operand registers and statusregister(s).

One possible form of multi-threading is parallelism. That is, as well asmultiple contexts, multiple execution pipelines are provided: i.e. aseparate execution pipeline for each stream of instructions to beexecuted in parallel. However, this requires a great deal of duplicationin terms of hardware.

Instead therefore, another form of multi-threaded processor employsconcurrency rather than parallelism, whereby the threads share a commonexecution pipeline (or at least a common part of a pipeline) anddifferent threads are interleaved through this same, shared executionpipeline. Performance of a multi-threaded processor may still beimproved compared to no concurrency or parallelism, thanks to increasedopportunities for hiding pipeline latency. Also, this approach does notrequire as much extra hardware dedicated to each thread as a fullyparallel processor with multiple execution pipelines, and so does notincur so much extra silicon.

One form of parallelism can be achieved by means of a processorcomprising an arrangement of multiple tiles on the same chip (i.e. samedie), each tile comprising its own separate respective processing unitand memory (including program memory and data memory). Thus separateportions of program code can be run in parallel on different ones of thetiles. The tiles are connected together via an on-chip interconnectwhich enables the code run on the different tiles to communicate betweentiles. In some cases the processing unit on each tile may itself runmultiple concurrent threads on tile, each tile having its own respectiveset of contexts and corresponding pipeline as described above in orderto support interleaving of multiple threads on the same tile through thesame pipeline.

In general, there may exist dependencies between the portions of aprogram running on different tiles. A technique is therefore required toprevent a piece of code on one tile running ahead of data upon which itis dependent being made available by another piece of code on anothertile. There are a number of possible schemes for achieving this, but thescheme of interest herein is known as “bulk synchronous parallel” (BSP).According to BSP, each tile performs a compute phase and an exchangephase in an alternating cycle. During the compute phase each tileperforms one or more computation tasks locally on tile, but does notcommunicate any results of its computations with any others of thetiles. In the exchange phase each tile is allowed to exchange one ormore results of the computations from the preceding compute phase toand/or from one or more others of the tiles in the group, but does notyet proceed to the next compute phase. Further, according to the BSPprinciple, a barrier synchronization is placed at the juncturetransitioning from the compute phase into the exchange phase, ortransitioning from the exchange phase into the compute phase, or both.That is it say, either: (a) all tiles are required to complete theirrespective compute phases before any in the group is allowed to proceedto the next exchange phase, or (b) all tiles in the group are requiredto complete their respective exchange phases before any tile in thegroup is allowed to proceed to the next compute phase, or (c) both. Insome scenarios a tile performing computation may be allowed tocommunicate with other system resources such as a network card orstorage disk, as long as no communication with other tiles in the groupis involved.

In an interconnected system of senders and receivers that may also havecompute tasks to perform in between communicating with one another,there are essentially three ways the senders and receivers can implementthis. The first is the “rendez vous” approach. According to thisapproach the sender signals to the receiver when it is ready to senddata and the receiver signals to the sender when it is ready to receivedata. If the sender has data ready to send but the receiver isperforming some other, compute task, then the sender must either waitfor the receiver to finish its computing task and signal its readinessto receive data from the sender, or else the sender must interrupt thereceiver. Similarly if the receiver requires data from the sender whilethe sender is still performing some other, compute task, then thereceiver must either wait for the sender to finish its compute task andsignal its readiness to send data to the receiver, or else the receivermust interrupt the sender. The rendez vous approach has the advantagethat it does not require queues to queue the transmitted data, sincecommunication of the data only proceeds once both sender and receiverhave agreed they are ready to communicate. However, the downside islatency: the senders and receivers will spend a lot of time waiting forone another, or else will have to perform a lot of interrupts which alsoincur a latency penalty. The latency ultimately manifests itself asreduced throughput.

The second possibility is the “post-box” approach. According to thisapproach the sender does not wait for the receiver before sending itsdata. Instead the transmitted data is buffered in a queue, from whichthe receiver reads the data when it is ready. As long as the queues arelong enough then this solves the latency problem of the rendez vousapproach. However, if the queues fill up then the process stalls and ineffect the communications fall back to the rendez vous approach. Toreduce the chance of this the queues need to be made long compared tothe amount of data likely to be transmitted. But queues incur asignificant silicon footprint, especially in an array of many potentialcombinations of senders and receivers. Also, in practice the queuescannot be made indefinitely long.

Bulk synchronous parallel (BSP) provides a third way: each tile performsa certain defined amount of compute processing in a compute phase, thenall tiles synchronize together (a barrier synchronization) beforeadvancing to an exchange phase. This does not incur as much latency asthe rendez vous approach, and does not incur as much queuing as thepost-box approach.

An example use of multi-threaded and/or multi-tiled processing is foundin machine intelligence. As will be familiar to those skilled in the artof machine intelligence, a machine intelligence algorithm is basedaround performing iterative updates to a “knowledge model”, which can berepresented by a graph of multiple interconnected nodes. Each noderepresents a function of its inputs. Some nodes receive the inputs tothe graph and some receive inputs from one or more other nodes, whilstthe output of some nodes form the inputs of other nodes, and the outputof some nodes provide the output of the graph (and in some cases a givennode may even have all of these: inputs to the graph, outputs from thegraph and connections to other nodes). Further, the function at eachnode is parameterized by one or more respective parameters, e.g.weights. During a learning stage the aim is, based on a set ofexperiential input data, to find values for the various parameters suchthat the graph as a whole will generate a desired output for a range ofpossible inputs. Various algorithms for doing this are known in the art,such as a back propagation algorithm based on stochastic gradientdescent. Over multiple iterations based on the input data, theparameters are gradually tuned to decrease their errors, and thus thegraph converges toward a solution. In a subsequent stage, the learnedmodel can then be used to make predictions of outputs given a specifiedset of inputs or to make inferences as to inputs (causes) given aspecified set of outputs.

The implementation of each node will involve the processing of data, andthe interconnections of the graph correspond to data to be exchangedbetween the nodes. Typically, at least some of the processing of eachnode can be carried out independently of some or all others of the nodesin the graph, and therefore large graphs expose great opportunities forconcurrency and/or parallelism.

SUMMARY

The present invention starts from a position of choosing a bulksynchronous parallel (BSP) approach as the basis for communicationsbetween tiles.

According to the present invention it is desired to implement BSP acrossa system comprising multiple processing tiles arranged into differenttime-deterministic domains, wherein communications between tiles in thesame domain are time-deterministic, but communications between tiles indifferent domains are non-time-deterministic. In such scenarios, theinventors have identified that it would be desirable to separate the BSPprocess into time-deterministic and non-time-deterministic stages, so asto prevent the time determinism of at least some of thetime-deterministic exchanges within time-deterministic domains frombeing contaminated by the non-time deterministic exchanges between suchdomains.

According to one aspect disclosed herein, there is provided a method ofoperating a system comprising multiple processor tiles divided into aplurality of domains wherein within each domain the tiles are connectedto one another via a respective instance of a time-deterministicinterconnect and between domains the tiles are connected to one anothervia a non-time-deterministic interconnect; the method comprising:

-   -   on each respective one of a participating group of some or all        of the tiles across the domains, performing a compute stage in        which the respective tile performs a respective one or more        on-tile computations, but communicates computation results        neither to nor from any others of the tiles in the group;    -   within each respective one of said one or more domains,        performing a respective internal barrier synchronization to        require that all the participating tiles in the respective        domain have completed the compute phase before any of the        participating tiles in the respective domain is allowed to        proceed to an internal exchange phase, thereby establishing a        common time-reference between all participating tiles internally        within each individual one of said one or more domains;    -   following the respective internal barrier synchronization,        performing said internal exchange phase within each of said one        or more domains, in which each participating tile within the        respective domain communicates one or more results of its        respective computations to and/or from one or more others of the        participating tiles within the same domain via the        time-deterministic interconnect, but communicates computation        results neither to nor from any others of said domains;    -   performing an external barrier synchronization to require all        the participating tiles of said domains to have completed the        internal exchange phase before any of the participating tiles is        allowed to proceed to an external exchange phase, thereby        establishing a common time-reference between all participating        tiles across the domains; and    -   following said external barrier synchronization, performing the        external exchange phase in which one or more of the        participating tiles communicate one or more of said computation        results with another of the domains via the        non-time-deterministic interconnect.

I.e. first one or more internal BSP stages are performed whereby tilesin the same time-deterministic domain synchronize and exchange data withone another, but are not required to synchronize with any entities indifferent deterministic domains, and do not exchange data between thesedomains. Then a separate external BSP stage is performed whereby alltiles across the wider non-time-deterministic realm synchronize in a“global sync” and then exchange data between domains.

One reason time determinism is desirable because it allows communicationbetween tiles in the same domain without incurring the silicon footprintof any queues in the respective interconnect.

Hence in embodiments, the communications via the non-time-deterministicinterconnect are queued, but the communications between tiles via thetime-deterministic interconnect are not queued.

In embodiments, over the time-deterministic interconnect, thecommunication between each pair of transmitting and receiving tile maybe performed by:

-   -   transmitting a message from the receiving tile, and    -   controlling the receiving tile to listen to an address of the        transmitting tile at a predetermined time interval after the        transmission by the transmitting tile, wherein the predetermined        time interval is equal to a total predetermined delay between        the transmitting and receiving tile, the time interval being set        by a compiler having predetermined information on the delay.

Another reason for making a divide between the time-deterministic andnon-time-deterministic realms is that time-determinism typically means aloss-less medium at the physical, but on the other hand it may not bepractical to extend this across an indefinite range of tiles. Thereforeagain it would be desirable to allow time-determinism within certaindomains whilst avoiding that the wider non-time-deterministiccommunications contaminates a time-deterministic exchange phase.

Hence in embodiments, the time-deterministic interconnect is lossless,whilst the non-time-deterministic interconnect is lossy at a physicallayer, transport layer or networking layer.

Another reason for a divide between the time-deterministic andnon-time-deterministic realms is that, in embodiments, atime-deterministic interconnect is provided for exchange of datainternally on-chip but it is less practical to make communicationsbetween chips time-deterministic.

Hence in embodiments, each of the domains may be a different respectivechip, with the time-deterministic interconnect being an internal on-chipinterconnect and the non-time-deterministic interconnect is an externalinterconnect between the chips.

A greater penalty will be incurred in exchanging data between chipscompared to internal communications between tiles on the same chip.External communication experiences longer latency and greateruncertainty versus an internal one, because it is less local.Connections between chips tend to have a lower wiring density due tolimitations imposed by the package, and hence less available databandwidth. Also, wires reach further and hence are more capacitive, andmore vulnerable to noise (which may result in loss and hence the needfor retransmission at the physical layer). Further, as well as a greaterphysical distance, data transfer between chips typically traverses agreater amount of logic such as SerDes (serializers-deserializers) andflow control mechanisms, all of which adds extra delay compared tointernal communications.

By separating internal, on-chip and external, off-chip BSP stages, thisprevents some of the exchanges between tiles on the same chip from being“contaminated” by the latency of a global exchange, which is a moreexpensive operation in terms of latency. If every BSP stage insteadinvolved a global sync and exchange then this would result in asignificantly slower program.

The different chips may be different dies on the same integrated circuit(IC) package, or different dies on different IC packages, or a mixtureof these.

Note also that more generally, it is not excluded that the dividebetween time-deterministic and non-time-deterministic realms is madeelsewhere, other than the on-chip/off-chip boundary. For example atime-deterministic interconnect could be provided for exchange of databetween subgroups of multiple chips, or alternatively differenttime-deterministic domains that are asynchronous with respect to oneanother could be formed on the same chip.

Hence in embodiments, each of the domains may comprise multiple chips,the time-deterministic interconnect being an external losslessinter-chip interconnect and the non-time-deterministic interconnect isan external lossy interconnect.

In embodiments, the method may comprise performing a series of repeatingiterations, each comprising a respective instance of the compute stage,followed by a respective instance of the internal barriersynchronization, followed by a respective instance of the internalexchange phase, followed by a respective instance of the externalbarrier synchronization, followed by a respective instance of theexternal exchange phase; where each successive iteration is not allowedto proceed until the external barrier synchronization of the immediatelypreceding iteration has been performed.

In embodiments, the method may comprise performing a sequence ofinstances of the compute phase each followed by a corresponding instanceof the internal exchange phase and then a corresponding instance of theinternal barrier synchronization, and the external barriersynchronization may follow the last the compute phase in said sequence.

In embodiments, each of one or more of said iterations may comprise arespective sequence of multiple instances of the compute phase eachfollowed by a corresponding instance of the internal exchange phase andthen a corresponding instance of the internal barrier synchronization,and the respective external barrier synchronization may follow the lastinstance of the compute phase in the respective sequence.

In embodiments, each of the internal and external barriersynchronizations may be performed by executing a synchronizationinstruction comprising an opcode and an operand, wherein the operandspecifies a mode of the synchronization instruction as being eitherinternal or external, and wherein the opcode, when executed, causeshardware logic in the time-deterministic interconnect to coordinate theperformance of the internal barrier synchronization when the operandspecifies the internal mode, and causes hardware logic in thenon-time-deterministic interconnect to coordinate the performance of theexternal barrier synchronization when the operand specifies the externalmode.

In embodiments, the method may comprise selecting one of plurality ofpredefined zones as the participating tiles, each zone comprising adifferent set or subset of said multiple domains.

In embodiments, the zones may be hierarchical, with at least two lowerlevel zones being nested within at least one higher level zone.

In embodiments, the operand of the synchronisation instruction myspecify which of a plurality of different possible variants of theexternal mode the external barrier synchronization applies to, eachcorresponding to a different one of said zones.

In embodiments, the variants of the external mode may specify at leastwhich hierarchical level of zone the external barrier synchronizationapplies to.

In embodiments, the external synchronization and exchange may comprise:

-   -   first performing a first-level external synchronization and then        exchange constrained within a first, lower-level one of said        hierarchical zones; and    -   following the first level synchronization and exchange,        performing a second-level external synchronization and exchange        across a second, higher level one of said zones.

In embodiments, one of said hierarchical zones may consists of all tileson in a same IC package, but none beyond; and/or one of saidhierarchical zones may consists of all tiles in a same card, but nonebeyond; and/or one of said hierarchical zones may consist of all tilesin a same chassis, but none beyond.

In embodiments, the method may comprise executing an abstain instructionon one or some of the tiles, the opcode of the abstain instructioncausing the tile or tiles on which it is executed to be opted-out ofsaid group.

In embodiments, in the external exchange phase, one or more of theparticipating tiles may also communicate one or more of said computationresults with a host processor via said external interconnect, the hostprocessor being implemented on a separate host processor chip.

In embodiments, in the compute phase, some or all of the participatingtiles may each run a batch of worker threads in an interleaved manner,and the internal barrier synchronization may require all the workerthreads in every batch to have exited.

In embodiments, the method may comprise using the system to perform amachine intelligence algorithm in which each node in a graph has one ormore respective input vertices and one or more respective outputvertices with the input vertices of at least some of the nodes being theoutput vertices of at least some others of the nodes, each nodecomprising a respective function relating its output vertices to itsinput vertices, with each respective function being parameterized by oneor more respective parameters, and each of the respective parametershaving an associated error, such that the graph converges toward asolution as the errors in some or all of the parameters reduce; whereineach of the tiles may be used to model a respective one or more of thenodes in the graph.

In embodiments, said chips may take the form of Al accelerator chipsassisting the host processor.

In alternative aspects of the present disclosure, the primary dividebetween the different levels of BSP could be made between the on-chipvs. off-chip realms, rather than necessarily dividing the BSP processaccording to time-deterministic and non-time deterministic realms. It isnot excluded that both the internal and external communications are madetime deterministic, or that neither are, or that the divide betweentime-deterministic realms is not particularly drawn according to whethertiles are one the same chip or different chips. In such cases theseparation of internal, on-chip and external, off-chip BSP will still beadvantageous in terms of the latency issued discussed previously.

Hence according to another aspect disclosed herein, there is provided amethod of operating a system comprising multiple processor chipsconnected together via an external interconnect, with at least one ofthe chips comprising an array of processor tiles connected together byan internal interconnect; the method comprising:

-   -   on each respective one of a participating group of some or all        of the tiles spanning one or more of the chips, performing a        compute stage in which the respective tile performs a respective        one or more on-tile computations, but communicates computation        results neither to nor from any others of the tiles in the        group;    -   on each respective one of said one or more chips, performing a        respective internal barrier synchronization to require that all        the participating tiles on the respective chip have completed        the compute phase before any of the participating tiles on the        respective chip is allowed to proceed to an internal exchange        phase;    -   following the respective internal barrier synchronization,        performing said internal exchange phase on each of said one or        more chips, in which each participating tile on the respective        chip communicates one or more results of its respective        computations to and/or from one or more others of the        participating tiles on the same chip via the internal        interconnect, but communicates computation results neither to        nor from any others of said chips;    -   performing an external barrier synchronization to require all        the patriating tiles on said one or more chips to have completed        the internal exchange phase before any of the tiles in the group        is allowed to proceed to an external exchange phase; and    -   following said external barrier synchronization, performing an        external exchange phase between a participating set of chips, in        which each of one or more of the tiles in said group        communicates one or more of said computation results with        another of the participating chips via the external        interconnect.

According to another aspect disclosed herein, there is provided computerprogram product embodied on computer-readable storage and comprisingcode configured so as when executed on said tiles to perform operationsin accordance with any of the methods disclosed herein.

According to another aspect disclosed herein, there is provided a systemcomprising multiple processor tiles divided into a plurality of domainswherein within each domain the tiles are connected to one another via arespective instance of a time-deterministic interconnect and betweendomains the tiles are connected to one another via anon-time-deterministic interconnect; the system being programmed toperform operations of:

-   -   on each respective one of a participating group of some or all        of the tiles across the domains, performing a compute stage in        which the respective tile performs a respective one or more        on-tile computations, but communicates computation results        neither to nor from any others of the tiles in the group;    -   within each respective one of said one or more domains,        performing a respective internal barrier synchronization to        require that all the participating tiles in the respective        domain have completed the compute phase before any of the        participating tiles in the respective domain is allowed to        proceed to an internal exchange phase, thereby establishing a        common time-reference between all participating tiles internally        within each individual one of said one or more domains;    -   following the respective internal barrier synchronization,        performing said internal exchange phase within each of said one        or more domains, in which each participating tile within the        respective domain communicates one or more results of its        respective computations to and/or from one or more others of the        participating tiles within the same domain via the        time-deterministic interconnect, but communicates computation        results neither to nor from any others of said domains;    -   performing an external barrier synchronization to require all        the participating tiles of said domains to have completed the        internal exchange phase before any of the participating tiles is        allowed to proceed to an external exchange phase, thereby        establishing a common time-reference between all participating        tiles across the domains; and    -   following said external barrier synchronization, performing the        external exchange phase in which one or more of the        participating tiles communicate one or more of said computation        results with another of the domains via the        non-time-deterministic interconnect.

BRIEF DESCRIPTION OF THE DRAWINGS

To aid understanding of the present disclosure and to show howembodiments may be put into effect, reference is made by way of exampleto the accompanying drawings in which:

FIG. 1 is a schematic block diagram of a multi-threaded processing unit,

FIG. 2 is a schematic block diagram of a plurality of thread contexts,

FIG. 3 schematically illustrates a scheme of interleaved execution timeslots,

FIG. 4 schematically illustrates a supervisor thread and plurality ofworker threads,

FIG. 5 is a schematic diagram of logic for aggregating exit states ofmultiple threads,

FIG. 6 schematically illustrates synchronization amongst worker threadson the same tile,

FIG. 7 is a schematic block diagram of a processor chip comprisingmultiple tiles,

FIG. 8 is a schematic illustration of a bulk synchronous parallel (BSP)computing model,

FIG. 9 is another schematic illustration of a BSP model,

FIG. 10 is a schematic illustration of BSP between multi-threadedprocessing units,

FIG. 11 is a schematic block diagram of an interconnect system,

FIG. 12 is a schematic illustration of system of multiple interconnectedprocessor chips,

FIG. 13 is a schematic illustration of a multi-tier BSP scheme,

FIG. 14 is another schematic illustration of a system of multipleprocessor chips,

FIG. 15 is a schematic illustration of a graph used in a machineintelligence algorithm,

FIG. 16 schematically illustrates an arrangement for exchanging databetween tiles,

FIG. 17 schematically illustrates a scheme of exchange timings,

FIG. 18 illustrates example wiring for synchronizing between chips, and

FIG. 19 schematically illustrates an external flow control mechanism forexchange between chips.

DETAILED DESCRIPTION OF EMBODIMENTS

The following describes components of a processor having an architecturewhich has been developed to address issues arising in the computationsinvolved in machine intelligence applications. The processor describedherein may be used as a work accelerator; that is, it receives aworkload from an application running on a host computer, the workloadgenerally being in the form of very large data sets to be processed(such as the large experience data sets used by a machine intelligencealgorithm to learn a knowledge model, or the data from which to performa prediction or inference using a previously-learned knowledge model).An aim of the architecture presented herein is to process these verylarge amounts of data highly efficiently. The processor architecture hasbeen developed for processing workloads involved in machineintelligence. Nonetheless, it will be apparent that the disclosedarchitecture may also be suitable for other workloads sharing similarcharacteristics.

FIG. 1 illustrates an example of a processor module 4 in accordance withembodiments of the present disclosure. For instance the processor module4 may be one tile of an array of like processor tiles on a same chip, ormay be implemented as a stand-alone processor on its own chip. Theprocessor module 4 comprises a multi-threaded processing unit 10 in theform of a barrel-threaded processing unit, and a local memory 11 (i.e.on the same tile in the case of a multi-tile array, or same chip in thecase of a single-processor chip). A barrel-threaded processing unit is atype of multi-threaded processing unit in which the execution time ofthe pipeline is divided into a repeating sequence of interleaved timeslots, each of which can be owned by a given thread. This will bediscussed in more detail shortly. The memory 11 comprises an instructionmemory 12 and a data memory 22 (which may be implemented in differentaddressable memory unit or different regions of the same addressablememory unit). The instruction memory 12 stores machine code to beexecuted by the processing unit 10, whilst the data memory 22 storesboth data to be operated on by the executed code and data output by theexecuted code (e.g. as a result of such operations).

The memory 12 stores a variety of different threads of a program, eachthread comprising a respective sequence of instructions for performing acertain task or tasks. Note that an instruction as referred to hereinmeans a machine code instruction, i.e. an instance of one of thefundamental instructions of the processor's instruction set, consistingof a single opcode and zero or more operands.

The program described herein comprises a plurality of worker threads,and a supervisor subprogram which may be structured as one or moresupervisor threads. These will be discussed in more detail shortly. Inembodiments, each of some or all of the worker threads takes the form ofa respective “codelet”. A codelet is a particular type of thread,sometimes also referred to as an “atomic” thread. It has all the inputinformation it needs to execute from the beginning of the thread (fromthe time of being launched), i.e. it does not take any input from anyother part of the program or from memory after being launched. Further,no other part of the program will use any outputs (results) of thethread until it has terminated (finishes). Unless it encounters anerror, it is guaranteed to finish. N.B. some literature also defines acodelet as being stateless, i.e. if run twice it could not inherit anyinformation from its first run, but that additional definition is notadopted here. Note also that not all of the worker threads need becodelets (atomic), and in embodiments some or all of the workers mayinstead be able to communicate with one another.

Within the processing unit 10, multiple different ones of the threadsfrom the instruction memory 12 can be interleaved through a singleexecution pipeline 13 (though typically only a subset of the totalthreads stored in the instruction memory can be interleaved at any givenpoint in the overall program). The multi-threaded processing unit 10comprises: a plurality of context register files 26 each arranged torepresent the state (context) of a different respective one of thethreads to be executed concurrently; a shared execution pipeline 13 thatis common to the concurrently executed threads; and a scheduler 24 forscheduling the concurrent threads for execution through the sharedpipeline in an interleaved manner, preferably in a round robin manner.The processing unit 10 is connected to a shared instruction memory 12common to the plurality of threads, and a shared data memory 22 that isagain common to the plurality of threads.

The execution pipeline 13 comprises a fetch stage 14, a decode stage 16,and an execution stage 18 comprising an execution unit which may performarithmetic and logical operations, address calculations, load and storeoperations, and other operations, as defined by the instruction setarchitecture. Each of the context register files 26 comprises arespective set of registers for representing the program state of arespective thread.

An example of the registers making up each of the context register files26 is illustrated schematically in FIG. 2. Each of the context registerfiles 26 comprises a respective one or more control registers 28,comprising at least a program counter (PC) for the respective thread(for keeping track of the instruction address at which the thread iscurrently executing), and in embodiments also a set of one or morestatus registers (SR) recording a current status of the respectivethread (such as whether it is currently running or paused, e.g. becauseit has encountered an error). Each of the context register files 26 alsocomprises a respective set of operand registers (OP) 32, for temporarilyholding operands of the instructions executed by the respective thread,i.e. values operated upon or resulting from operations defined by theopcodes of the respective thread's instructions when executed. It willbe appreciated that each of the context register files 26 may optionallycomprise a respective one or more other types of register (not shown).Note also that whilst the term “register file” is sometimes used torefer to a group of registers in a common address space, this does notnecessarily have to be the case in the present disclosure and each ofthe hardware contexts 26 (each of the register sets 26 representing eachcontext) may more generally comprise one or multiple such registerfiles.

As will be discussed in more detail later, the disclosed arrangement hasone worker context register file CX0 . . . CX(M−1) for each of thenumber M of threads that can be executed concurrently (M=3 in theexample illustrated but this is not limiting), and one additionalsupervisor context register file CXS. The worker context register filesare reserved for storing the contexts of worker threads, and thesupervisor context register file is reserved for storing the context ofa supervisor thread. Note that in embodiments the supervisor context isspecial, in that it has a different number of registers than each of theworkers. Each of the worker contexts preferably have the same number ofstatus registers and operand registers as one another. In embodimentsthe supervisor context may have fewer operand registers than each of theworkers. Examples of operand registers the worker context may have thatthe supervisor does not include: floating point registers, accumulateregisters, and/or dedicated weight registers (for holding weights of aneural network). In embodiments the supervisor may also have a differentnumber of status registers. Further, in embodiments the instruction setarchitecture of the processor module 4 may be configured such that theworker threads and supervisor thread(s) execute some different types ofinstruction but also share some instruction types.

The fetch stage 14 is connected so as to fetch instructions to beexecuted from the instruction memory 12, under control of the scheduler24. The scheduler 24 is configured to control the fetch stage 14 tofetch an instruction from each of a set of concurrently executingthreads in turn in a repeating sequence of time slots, thus dividing theresources of the pipeline 13 into a plurality of temporally interleavedtime slots, as will be discussed in more detail shortly. For example thescheduling scheme could be round-robin or weighted round-robin. Anotherterm for a processor operating in such a manner is a barrel threadedprocessor.

In some embodiments, the scheduler 24 may have access to one of thestatus registers SR of each thread indicating whether the thread ispaused, so that the scheduler 24 in fact controls the fetch stage 14 tofetch the instructions of only those of the threads that are currentlyactive In embodiments, preferably each time slot (and correspondingcontext register file) is always owned by one thread or another, i.e.each slot is always occupied by some thread, and each slot is alwaysincluded in the sequence of the scheduler 24; though the threadoccupying any given slot may happen to be paused at the time, in whichcase when the sequence comes around to that slot, the instruction fetchfor the respective thread is passed over. Alternatively it is notexcluded for example that in alternative, less preferredimplementations, some slots can be temporarily vacant and excluded fromthe scheduled sequence. Where reference is made to the number of timeslots the execution unit is operable to interleave, or such like, thisrefers to the maximum number of slots the execution is capable ofexecuting concurrently, i.e. the number unit's hardware supports.

The fetch stage 14 has access to the program counter (PC) of each of thecontexts. For each respective thread, the fetch stage 14 fetches thenext instruction of that thread from the next address in the programmemory 12 as indicated by the program counter. The program counterincrements each execution cycle unless branched by a branch instruction.The fetch stage 14 then passes the fetched instruction to the decodestage 16 to be decoded, and the decode stage 16 then passes anindication of the decoded instruction to the execution unit 18 alongwith the decoded addresses of any operand registers 32 specified in theinstruction, in order for the instruction to be executed. The executionunit 18 has access to the operand registers 32 and the control registers28, which it may use in executing the instruction based on the decodedregister addresses, such as in the case of an arithmetic instruction(e.g. by adding, multiplying, subtracting or dividing the values in twooperand registers and outputting the result to another operand registerof the respective thread). Or if the instruction defines a memory access(load or store), the load/store logic of the execution unit 18 loads avalue from the data memory into an operand register of the respectivethread, or stores a value from an operand register of the respectivethread into the data memory 22, in accordance with the instruction. Orif the instruction defines a branch or a status change, the executionunit changes value in the program counter PC or one of the statusregisters SR accordingly. Note that while one thread's instruction isbeing executed by the execution unit 18, an instruction from the threadin the next time slot in the interleaved sequence can be being decodedby the decode stage 16; and/or while one instruction is being decoded bythe decode stage 16, the instruction from the thread in the next timeslot after that can be being fetched by the fetch stage 14 (though ingeneral the scope of the disclosure is not limited to one instructionper time slot, e.g. in alternative scenarios a batch of two or moreinstructions could be issued from a given thread per time slot). Thusthe interleaving advantageously hides latency in the pipeline 13, inaccordance with known barrel threaded processing techniques.

An example of the interleaving scheme implemented by the scheduler 24 isillustrated in FIG. 3. Here the concurrent threads are interleavedaccording to a round-robin scheme whereby, within each round of thescheme, the round is divided into a sequence of time slots S0, S1, S2 .. . , each for executing a respective thread. Typically each slot is oneprocessor cycle long and the different slots are evenly sized, thoughnot necessarily so in all possible embodiments, e.g. a weightedround-robin scheme is also possible whereby some threads get more cyclesthan others per execution round. In general the barrel-threading mayemploy either an even round-robin or a weighted round-robin schedule,where in the latter case the weighting may be fixed or adaptive.

Whatever the sequence per execution round, this pattern then repeats,each round comprising a respective instance of each of the time slots.Note therefore that a time slot as referred to herein means therepeating allocated place in the sequence, not a particular instance ofthe time slot in a given repetition of the sequence. Put another way,the scheduler 24 apportions the execution cycles of the pipeline 13 intoa plurality of temporally interleaved (time-division multiplexed)execution channels, with each comprising a recurrence of a respectivetime slot in a repeating sequence of time slots. In the illustratedembodiment, there are four time slots, but this is just for illustrativepurposes and other numbers are possible. E.g. in one preferredembodiment there are in fact six time slots.

Whatever the number of time slots the round-robin scheme is dividedinto, then according to present disclosure, the processing unit 10comprises one more context register file 26 than there are time slots,i.e. it supports one more context than the number of interleavedtimeslots it is capable of barrel-threading.

This is illustrated by way of example in FIG. 2: if there are four timeslots S0 . . . S3 as shown in FIG. 3, then there are five contextregister files, labelled here CX0, CX1, CX2, CX3 and CXS. That is, eventhough there are only four execution time slots S0 . . . S3 in thebarrel-threaded scheme and so only four threads can be executedconcurrently, it is disclosed herein to add a fifth context registerfile CXS, comprising a fifth program counter (PC), a fifth set ofoperand registers 32, and in embodiments also a fifth set of one or morestatus registers (SR). Though note that as mentioned, in embodiments thesupervisor context may differ from the others CX0 . . . 3, and thesupervisor thread may support a different set of instructions foroperating the execution pipeline 13.

Each of the first four contexts CX0 . . . CX3 is used to represent thestate of a respective one of a plurality of “worker threads” currentlyassigned to one of the four execution time slots S0 . . . S3, forperforming whatever application-specific computation tasks are desiredby the programmer (note again this may only be subset of the totalnumber of worker threads of the program as stored in the instructionmemory 12). The fifth context CXS however, is reserved for a specialfunction, to represent the state of a “supervisor thread” (SV) whoserole it is to coordinate the execution of the worker threads, at leastin the sense of assigning which of the worker threads W is to beexecuted in which of the time slots S0, S1, S2 . . . at what point inthe overall program. Optionally the supervisor thread may have other“overseer” or coordinating responsibilities. For example, the supervisorthread may be responsible for performing barrier synchronisations toensure a certain order of execution. E.g. in a case where one or moresecond threads are dependent on data to be output by one or more firstthreads run on the same processor module 4, the supervisor may perform abarrier synchronization to ensure that none of the second threads beginsuntil the first threads have finished. And/or, the supervisor mayperform a barrier synchronization to ensure that one or more threads onthe processor module 4 do not begin until a certain external source ofdata, such as another tile or processor chip, has completed theprocessing required to make that data available. The supervisor threadmay also be used to perform other functionality relating to the multipleworker threads. For example, the supervisor thread may be responsiblefor communicating data externally to the processor module 4 (to receiveexternal data to be acted on by one or more of the threads, and/or totransmit data output by one or more of the worker threads). In generalthe supervisor thread may be used to provide any kind of overseeing orcoordinating function desired by the programmer. For instance as anotherexample, the supervisor may oversee transfer between the tile localmemory 12 and one or more resources in the wider system (external to thearray 6) such as a storage disk or network card.

Note of course that four time slots is just an example, and generally inother embodiments there may be other numbers, such that if there are amaximum of M time slots 0 . . . M−1 per round, the processor module 4comprises M+1 contexts CX . . . CX(M−1) & CXS, i.e. one for each workerthread that can be interleaved at any given time and an extra contextfor the supervisor. E.g. in one exemplary implementation there are sixtimeslots and seven contexts.

Referring to FIG. 4, the supervisor thread SV does not have its own timeslot per se in the scheme of interleaved time slots. Nor do the workersas allocation of slots to worker threads is flexibly defined. Rather,each time slot has its own dedicated context register file (CX0 . . .CXM−1) for storing worker context, which is used by the worker when theslot is allocated to the worker, but not used when the slot is allocatedto the supervisor. When a given slot is allocated to the supervisor,that slot instead uses the context register file CVS of the supervisor.Note that the supervisor always has access to its own context and noworkers are able to occupy the supervisor context register file CXS.

The supervisor thread SV has the ability to run in any and all of thetime slots S0 . . . S3 (or more generally S0 . . . SM−1). The scheduler24 is configured so as, when the program as a whole starts, to begin byallocating the supervisor thread to all of the time slots, i.e. so thesupervisor SV starts out running in all of S0 . . . S3. However, thesupervisor thread is provided with a mechanism for, at some subsequentpoint (either straight away or after performing one or more supervisortasks), temporarily relinquishing each of the slots in which it isrunning to a respective one of the worker threads, e.g. initiallyworkers W0 . . . W3 in the example shown in FIG. 4. This is achieved bythe supervisor thread executing a relinquish instruction, called “RUN”by way of example herein. In embodiments this instruction takes twooperands: an address of a worker thread in the instruction memory 12 andan address of some data for that worker thread in the data memory 22:

RUN task_addr, data_addr

The worker threads are portions of code that can be run concurrentlywith one another, each representing one or more respective computationtasks to be performed. The data address may specify some data to beacted upon by the worker thread. Alternatively, the relinquishinstruction may take only a single operand specifying the address of theworker thread, and the data address could be included in the code of theworker thread; or in another example the single operand could point to adata structure specifying the addresses of the worker thread and data.As mentioned, in embodiments at least some of the workers may take theform of codelets, i.e. atomic units of concurrently executable code.Alternatively or additionally, some of the workers need not be codeletsand may instead be able to communicate with one another.

The relinquish instruction (“RUN”) acts on the scheduler 24 so as torelinquish the current time slot, in which this instruction is itselfexecuted, to the worker thread specified by the operand. Note that it isimplicit in the relinquish instruction that it is the time slot in whichthis instruction is executed that is being relinquished (implicit in thecontext of machine code instructions means it doesn't need an operand tospecify this—it is understood implicitly from the opcode itself). Thusthe time slot which is given away is the time slot in which thesupervisor executes the relinquish instruction. Or put another way, thesupervisor is executing in the same space that that it gives away. Thesupervisor says “run this piece of code at this location”, and then fromthat point onwards the recurring slot is owned (temporarily) by therelevant worker thread.

The supervisor thread SV performs a similar operation in each of one ormore others of the time slots, to give away some or all of its timeslots to different respective ones of the worker threads W0 . . . W3(selected from a larger set W0 . . . wj in the instruction memory 12).Once it has done so for the last slot, the supervisor is suspended (thenlater will resume where it left off when one of the slots is handed backby a worker W).

The supervisor thread SV is thus able to allocate different workerthreads, each performing one or more tasks, to different ones of theinterleaved execution time slots S0 . . . S3. When the supervisor threaddetermines it is time to run a worker thread, it uses the relinquishinstruction (“RUN”) to allocates this worker to the time slot in whichthe RUN instruction was executed.

In some embodiments, the instruction set also comprises a variant of therun instruction, RUNALL (“run all”). This instruction is used to launcha set of more than one worker together, all executing the same code. Inembodiments this launches a worker in every one of the processing unit'sslots S0 . . . S3 (or more generally S0 . . . S(M−1)).

Further, in some embodiments the RUN and/or RUNALL instruction, whenexecuted, also automatically copies some status from one or more of thesupervisor status registers CXS(SR) to a corresponding one or morestatus registers of the worker thread(s) launched by the RUN or RUNALL.For instance the copied status may comprise one or more modes, such as afloating point rounding mode (e.g. round to nearest or round to zero)and/or an overflow mode (e.g. saturate or use a separate valuerepresenting infinity). The copied status or mode then controls theworker in question to operate in accordance with the copied status ormode. In embodiments, the worker can later overwrite this in its ownstatus register (but cannot change the supervisor's status). In furtheralternative or additional embodiments, that the workers can choose toread some status from one or more status registers of the supervisor(and again may change their own status later). E.g. again this could beto adopt a mode from the supervisor status register, such as a floatingpoint mode or a rounding mode. In embodiments however, the supervisorcannot read any of the context registers CX0 . . . of the workers.

Once launched, each of the currently allocated worker threads W0 . . .W3 proceeds to perform the one or more computation tasks defined in thecode specified by the respective relinquish instruction. At the end ofthis, the respective worker thread then hands the time slot in which itis running back to the supervisor thread. This is achieved by executingan exit instruction (“EXIT”).

The EXIT instruction takes at least one operand and preferably only asingle operand, exit_state (e.g. a binary value), to be used for anypurpose desired by the programmer to indicate a state of the respectivecodelet upon ending (e.g. to indicate whether a certain condition wasmet):

EXIT exit_state

The EXIT instruction acts on the scheduler 24 so that the time slot inwhich it is executed is returned back to the supervisor thread. Thesupervisor thread can then perform one or more subsequent supervisortasks (e.g. barrier synchronization and/or exchange of data withexternal resources such as other tiles), and/or continue to executeanother relinquish instruction to allocate a new worker thread (W4,etc.) to the slot in question. Note again therefore that the totalnumber of threads in the instruction memory 12 may be greater than thenumber that barrel-threaded processing unit 10 can interleave at any onetime. It is the role of the supervisor thread SV to schedule which ofthe worker threads W0 . . . Wj from the instruction memory 12, at whichstage in the overall program, are to be assigned to which of theinterleaved time slots S0 . . . SM in the round robin schedule of thescheduler 24. Furthermore, the EXIT instruction is given a furtherspecial function, namely to cause the exit state specified in theoperand of the EXIT instruction to be automatically aggregated (bydedicated hardware logic) with the exit states of a plurality of otherworker threads being run through the same pipeline 13 of the sameprocessor module 4 (e.g. same tile). Thus an extra, implicit facility isincluded in the instruction for terminating a worker thread.

An example circuit for achieving this is shown in FIG. 5. In thisexample, the exit states of the individual threads and the aggregatedexit state each take the form of a single bit, i.e. 0 or 1. Theprocessor module 4 comprises a register 38 for storing the aggregatedexit state of that processor module 4. This register may be referred toherein as the “local consensus” register $LC (as opposed to a globalconsensus when the processor module 4 is included as one of an array ofsimilar processor tiles, to be discussed in more detail shortly). Inembodiments this local consensus register $LC 38 is one of thesupervisor's status registers in the supervisor's context register fileCXS. The logic for performing the aggregation comprises an AND gate 37arranged to perform a logical AND of (A) the exit state specified in theEXIT instructions' operand and (B) the current value in the localconsensus register ($LC) 38, and to output the result (Q) back into thelocal consensus register $LC 38 as a new value of the local aggregate.

At a suitable synchronization point in the program, the value stored inthe local consensus register ($LC) 38 is initially reset to a valueof 1. I.e. any threads exiting after this point will contribute to thelocally aggregated exit state $LC until next reset. The output (Q) ofthe AND gate 37 is 1 if both inputs (A, B) are 1, but otherwise theoutput Q goes to 0 if any of the inputs (A, B) is 0. Every time an EXITinstruction is executed its exit state is aggregated with those thathave gone before (since last reset). Thus by means of the arrangementshown in FIG. 5, the logic keeps a running aggregate of the exit statesof any worker threads which have terminated by means of an EXITinstruction since the last time the local consensus register ($LC) 38was reset. In this example the running aggregate refers to whether ornot all threads so far have exited true: any exit state of 0 from any ofthe worker threads will mean the aggregate in the register 38 becomeslatched to 0 until the next reset. In embodiments the supervisor SV canread the running aggregate at any time by getting the current value fromthe local consensus register ($LC) 38 (it does not need to wait for anon-tile synchronization to do so).

The reset of the aggregate in the local consensus register ($LC) 38 maybe performed by the supervisor SV performing a PUT to the registeraddress of the local consensus register ($LC) 38 using one or moregeneral purpose instructions, in this example to put a value of 1 to theregister 38. Alternatively it is not excluded that the reset could beperformed by an automated mechanism, for example triggered by executingthe SYNC instruction described later herein.

The aggregation circuitry 37, in this case the AND gate, is implementedin dedicated hardware circuitry in the execution unit of the executionstage 18, using any suitable combination of electronic components forforming the functionality of a Boolean AND. Dedicated circuitry orhardware means circuitry having a hard-wired function, as opposed tobeing programmed in software using general purpose code. The updating ofthe local exit state is triggered by the execution of the special EXITinstruction, this being one of the fundamental machine code instructionsin the instruction set of the processor module 4, having the inherentfunctionality of aggregating the exit states. Also, the local aggregateis stored in a control register 38, meaning a dedicated piece of storage(in embodiments a single bit of storage) whose value can be accessed bythe code running on the pipeline, but which is not usable by theload-store unit (LSU) to store any general purpose data. Instead, thefunction of data held in a control register is fixed, in this case tothe function of storing the locally aggregated exit state. Preferablythe local consensus register ($LC) 38 forms one of the control registerson the processor module 4 (e.g. on tile), whose value the supervisor canaccess by executing a GET instruction and can be set by executing a PUTinstruction.

Note that the circuit shown in FIG. 5 is just one example. An equivalentcircuit would be to replace the AND gate 37 with an OR gate and toinvert the interpretation of the exit states 0 and 1 in software, i.e.0→true, 1→false (with the register 38 being reset to 0 rather than 1 ateach synchronization point). Equivalently if the AND gate is replacedwith an OR gate but the interpretation of the exit states is notinverted, nor the reset value, then the aggregated state in $LC willrecord whether any (rather than all) the worker states exited with state1.

In other embodiments, the exit states need not be single bits. E.g. theexit state of each individual worker may be a single bit, but theaggregated exit state $LC may comprise two bits representing a trinarystate: all workers exited with state 1, all workers exited with state 0,or the workers' exit states were mixed. As an example of the logic forimplementing this, one of the two bits encoding the trinary value may bea Boolean AND (or OR) of the individual exit states, and the other bitof the trinary value may be a Boolean OR of the individual exit states.The third encoded case, indicating that the worker's exit states weremixed, can then be formed as the XOR of these two bits.

The exit states can be used to represent whatever the programmer wishes,but one particularly envisaged example is to use an exit state of 1 toindicate that the respective worker thread has exited in a “successful”or “true” state, whilst an exit state of 0 indicates the respectiveworker thread exited in an “unsuccessful” or “false” state (or viceversa if the aggregation circuitry 37 performs an OR instead of an ANDand the register $LC 38 is reset initially to 0). For instance, consideran application where each worker thread performs a computation having anassociated condition, such as a condition indicating whether theerror(s) in the one or more parameters of a respective node in the graphof a machine intelligence algorithm has/have fallen within an acceptablelevel according to a predetermined metric. In this case, an individualexit state of one logical level (e.g. 1) may be used to indicate thatthe condition is satisfied (e.g. the error or errors in the one or moreparameters of the node are within an acceptable level according to somemetric); whilst an individual exit state of the opposite logical level(e.g. 0) may be used to indicate that the condition was not satisfied(e.g. the error or errors are not within an acceptable level accordingto the metric in question). The condition may for example be an errorthreshold placed on a single parameter or each parameter, or could be amore complex function of a plurality of parameters associated with therespective computation performed by the worker thread.

As another more complex example, the individual exit states of theworkers and the aggregated exit state may each comprise two or morebits, which may be used, for example, to represent a degree ofconfidence in the results of the worker threads. E.g. the exit state ofeach individual worker thread may represent a probabilistic measure ofconfidence in a result of the respective worker thread, and theaggregation logic 37 may be replaced with more complex circuitry forperforming a probabilistic aggregation of the individual confidencelevels in hardware.

Whatever meaning is given by the programmer to the exit states, thesupervisor thread SV can then get the aggregated value from the localconsensus register ($LC) 38 to determine the aggregated exit state ofall the worker threads that exited since it was last reset, for exampleat the last synchronization point, e.g. to determine whether or not allthe workers exited in a successful or true state. In dependence on thisaggregated value, the supervisor thread may then make a decision inaccordance with the programmer's design. The programmer can choose tomake whatever use of the locally aggregated exit state that he or shewishes. For example, the supervisor thread may consult the localaggregated exit state in on order to determine whether a certain portionof the program made up of a certain subset of worker threads hascompleted as expected or desired. If not (e.g. at least one of theworker threads exited in an unsuccessful or false state), it may reportto a host processor, or may perform another iteration of the part of theprogram comprising the same worker threads; but if so (e.g. all theworker threads exited in a successful or true state) it may insteadbranch to another part of the program comprising one or more newworkers.

Preferably the supervisor thread should not access the value in thelocal consensus register ($LC) 38 until all the worker threads inquestion have exited, such that the value stored therein represents thecorrect, up-to-date aggregate state of all the desired threads. Waitingfor this may be enforced by a barrier synchronization performed by thesupervisor thread to wait all currently-running local worker threads(i.e. those on the same processor module 4, running through the samepipeline 13) to exit. That is, the supervisor thread resets the localconsensus register ($LC) 38, launches a plurality of worker threads, andthen initiates a local barrier synchronization (local to the processingmodule 4, local to one tile) in order to wait for all the outstandingworker threads to exit before the supervisor is allowed to proceed toget the aggregated exit state from the local consensus register ($LC)38.

Referring to FIG. 6, in embodiments a SYNC (synchronization) instructionis provided in the processor's instruction set. The SYNC instruction hasthe effect of causing the supervisor thread SV to wait until allcurrently executing workers W have exited by means of an EXITinstruction. In embodiments the SYNC instruction takes a mode as anoperand (in embodiments its only operand), the mode specifying whetherthe SYNC is to act only locally in relation to only those worker threadsrunning locally on the same processor module 4, e.g. same tile, as thesupervisor as part of which the SYNC is executed on (i.e. only threadsthrough the same pipeline 13 of the same barrel-threaded processing unit10); or whether instead it is to apply across multiple tiles or evenacross multiple chips.

SYNC mode //mode ∈{tile, chip, zone_1, zone_2}

This will be discussed in more detail later but for the purposes of FIG.6 a local SYNC will be assumed (“SYNC tile”, i.e. a synchronizationwithin a single tile).

The workers do not need to be identified as operands of the SYNCinstruction, as it is implicit that the supervisor SV is then caused toautomatically wait until none of the time slots S0, S1, . . . of thebarrel-threaded processing unit 10 is occupied by a worker. As shown inFIG. 6, once each of a current batch of workers WLn have all beenlaunched by the supervisor, the supervisor then executes a SYNCinstruction. If the supervisor SV launches workers Win all the slots S0. . . 3 of the barrel-threaded processing unit 10 (all four in theexample illustrated, but that is just one example implementation), thenthe SYNC will be executed by the supervisor once the first of thecurrent batch of worker threads WLn has exited, thus handing backcontrol of at least one slot to the supervisor SV. Otherwise if theworkers do not take up all of the slots, the SYNC will simply beexecuted immediately after the last thread of the current batch WLn hasbeen launched. Either way, the SYNC causes the supervisor SV to wait forall others of the current batch of workers WLn−1 to execute an EXITbefore the supervisor can proceed. Only after this the supervisorexecutes a GET instruction to get the content of the local consensusregister ($LC) 38. This waiting by the supervisor thread is imposed inhardware once the SYNC has been executed. I.e. in response to the opcodeof the SYNC instruction, the logic in the execution unit (EXU) of theexecution stage 18 causes the fetch stage 14 and scheduler 24 to pausefrom issuing instructions of the supervisor thread until all outstandingworker threads have executed an EXIT instruction. At some point aftergetting the value of the local consensus register ($LC) 38 (optionallywith some other supervisor code in between), the supervisor executes aPUT instruction to reset the local consensus register ($LC) 38 (in theillustrated example to 1).

As also illustrated in FIG. 6, the SYNC instruction may also be used toplace synchronization barriers between different interdependent layersWL1, WL2, WL3, . . . of worker threads, where one or more threads ineach successive layer is dependent on data output by one or more workerthreads in its preceding layer. The local SYNC executed by thesupervisor thread ensures that none of the worker threads in the nextlayer WLn+1 executes until all the worker threads in the immediatelypreceding layer WLn have exited (by executing an EXIT instruction).

As mentioned, in embodiments the processor module 4 may be implementedas one of an array of interconnected tiles forming a multi-tileprocessor, wherein each of tile may be configured as described above inrelation to FIGS. 1 to 6.

This is illustrated further in FIG. 7 which shows a single chipprocessor 2, i.e. a single die, comprising an array 6 of multipleprocessor tiles 4 and an on-chip interconnect 34 connecting between thetiles 4. The chip 2 may be implemented alone on its own single-chipintegrated circuit package, or as one of multiple dies packaged in thesame IC package. The on-chip interconnect may also be referred to hereinas the “exchange fabric” 34 as it enables the tiles 4 to exchange datawith one another. Each tile 4 comprises a respective instance of thebarrel-threaded processing unit 10 and memory 11, each arranged asdescribed above in relation to FIGS. 1 to 6. For instance, by way ofillustration the chip 2 may comprise of the order of hundreds of tiles4, or even over a thousand. For completeness, note also that an “array”as referred to herein does not necessarily imply any particular numberof dimensions or physical layout of the tiles 4.

In embodiments each chip 2 also comprises one or more external links 8,enabling the chip-2 to be connected to one or more other, externalprocessors on different chips (e.g. one or more other instances of thesame chip 2). These external links 8 may comprise any one or more of:one or more chip-to-host links for connecting the chip 2 to a hostprocessor, and/or one or more chip-to-chip links for connecting togetherwith one or more other instances of the chip 2 on the same IC package orcard, or on different cards. In one example arrangement, the chip 2receives work from a host processor (not shown) which is connected tothe chip via one of the chip-to-host links in the form of input data tobe processed by the chip 2. Multiple instances of the chip 2 can beconnected together into cards by chip-to-chip links. Thus a host mayaccess a computer which is architected as a single chip processor 2 oras multiple single chip processors 2 possibly arranged on multipleinterconnected cards, depending on the workload required for the hostapplication.

The interconnect 34 is configured to enable the different processortiles 4 in the array 6 to communicate with one another on-chip 2.However, as well as there potentially being dependencies between threadson the same tile 4, there may also be dependencies between the portionsof the program running on different tiles 4 in the array 6. A techniqueis therefore required to prevent a piece of code on one tile 4 runningahead of data upon which it is dependent being made available by anotherpiece of code on another tile 4.

This may be achieved by implementing a bulk synchronous parallel (BSP)exchange scheme, as illustrated schematically in FIGS. 8 and 9.

According to one version of BSP, each tile 4 performs a compute phase 52and an exchange phase 50 in an alternating cycle, separated from one tothe other by a barrier synchronization 30 between tiles. In the caseillustrated a barrier synchronization is placed between each computephase 52 and the following exchange phase 50. During the compute phase52 each tile 4 performs one or more computation tasks locally on-tile,but does not communicate any results of these computations with anyothers of the tiles 4. In the exchange phase 50 each tile 4 is allowedto exchange one or more results of the computations from the precedingcompute phase to and/or from one or more others of the tiles in thegroup, but does not perform any new computations until it has receivedfrom other tiles 4 any data on which its task(s) has/have dependency.Neither does it send to any other tile any data except that computed inthe preceding compute phase. It is not excluded that other operationssuch as internal control-related operations may be performed in theexchange phase. In embodiments the exchange phase 50 does not includeany non-time-deterministic computations, but a small number oftime-deterministic computations may optionally be allowed during theexchange phase 50. Note also that a tile 4 performing computation may beallowed during the compute phase 52 to communicate with other externalsystem resources external to the array of tiles 4 beingsynchronized—e.g. a network card, disk drive, or field programmable gatearray (FPGA)—as long as this does not involve communication with othertiles 4 within the group being synchronized. The communication externalto the tile group may optionally utilise the BSP mechanism, butalternatively may not utilize BSP and may instead use some othersynchronization mechanism of its own.

According to the BSP principle, a barrier synchronization 30 is placedat the juncture transitioning from the compute phases 52 into theexchange phase 50, or the juncture transitioning from the exchangephases 50 into the compute phase 52, or both. That is to say, either:(a) all tiles 4 are required to complete their respective compute phases52 before any in the group is allowed to proceed to the next exchangephase 50, or (b) all tiles 4 in the group are required to complete theirrespective exchange phases 50 before any tile in the group is allowed toproceed to the next compute phase 52, or (c) both of these conditions isenforced. In all three variants it is the individual processors whichalternate between phases, and the whole assembly which synchronizes. Thesequence of exchange and compute phases may then repeat over multiplerepetitions. In BSP terminology, each repetition of exchange phase andcompute phase is sometimes referred to as a “superstep” (though notethat in the literature the terminology is not always used consistently:sometimes each individual exchange phase and compute phase individuallyis called a superstep, whereas elsewhere, as in the terminology adoptedherein, the exchange and compute phases together are referred to as asuperstep).

Note also, it is not excluded that multiple different independent groupsof tiles 4 on the same chip 2 or different chips could each form aseparate respective BSP group operating asynchronously with respect toone another, with the BSP cycle of compute, synchronize and exchangebeing imposed only within each given group, but each group doing soindependently of the other groups. I.e. a multi-tile array 6 mightinclude multiple internally synchronous groups each operatingindependently and asynchronously to the other such groups (discussed inmore detail later). In some embodiments there is a hierarchical groupingof sync and exchange, as will be discussed in more detail later.

FIG. 9 illustrates the BSP principle as implemented amongst a group 4 i,4 ii, 4 iii of some or all of the tiles in the array 6, in the casewhich imposes: (a) a barrier synchronization from compute phase 52 toexchange phase 50 (see above). Note that in this arrangement, some tiles4 are allowed to begin computing 52 whilst some others are stillexchanging.

According to embodiments disclosed herein, this type of BSP may befacilitated by incorporating additional, special, dedicatedfunctionality into a machine code instruction for performing barriersynchronization, i.e. the SYNC instruction.

In embodiments, the SYNC function takes this functionality whenqualified by an inter-tile mode as an operand, e.g. the on-chip mode:SYNC chip.

This is illustrated schematically in FIG. 10. In the case where eachtile 4 comprises a multi-threaded processing unit 10, then each tile'scompute phase 52 may in fact comprise tasks performed by multiple workerthreads W on the same tile 4 (and a given compute phase 52 on a giventile 4 may comprise one or more layers WL of worker threads, which inthe case of multiple layers may be separated by internal barriersynchronizations using the SYNC instruction with the local on-tile modeas an operand, as described previously). Once the supervisor thread SVon a given tile 4 has launched the last worker thread in the current BSPsuperstep, the supervisor on that tile 4 then executes a SYNCinstruction with the inter-tile mode set as the operand: SYNC chip. Ifthe supervisor is to launch (RUN) worker threads in all the slots of itsrespective processing unit 10, the “SYNC chip” is executed as soon asthe first slot that is no longer needed to RUN any more workers in thecurrent BSP superstep is handed back to the supervisor. E.g. this mayoccur after the first thread to EXIT in the last layer WL, or simplyafter the first worker thread to EXIT if there is only a single layer.Otherwise if not all the slots are to be used for running workers in thecurrent BSP superstep, the “SYNC chip” can be executed as soon as thelast worker that needs to be RUN in the current BSP superstep has beenlaunched. This may occur once all the workers in the last layer havebeen RUN, or simply once all the worker threads have been RUN if thereis only one layer.

The execution unit (EXU) of the execution stage 18 is configured so as,in response to the opcode of the SYNC instruction, when qualified by theon-chip (inter-tile) operand, to cause the supervisor thread in whichthe “SYNC chip” was executed to be paused until all the tiles 4 in thearray 6 have finished running workers. This can be used to implement abarrier to the next BSP superstep. I.e. after all tiles 4 on the chip 2have passed the barrier, the cross-tile program as a whole can progressto the next exchange phase 50.

FIG. 11 gives a schematic diagram illustrating the logic trigged by a“SYNC chip” according to embodiments disclosed herein.

Once the supervisor has launched (RUN) all of the threads it intends toin the current compute cycle 52, it then executes a SYNC instructionwith the on-chip, inter-tile operand:

SYNC chip. This triggers the following functionality to be triggered indedicated synchronization logic 39 on the tile 4, and in asynchronization controller 36 implemented in the hardware interconnect34. This functionality of both the on-tile sync logic 39 and thesynchronization controller 36 in the interconnect 34 is implemented indedicated hardware circuitry such that, once the SYNC chip is executed,the rest of the functionality proceeds without further instructionsbeing executed to do so.

Firstly, the on-tile sync logic 39 causes the instruction issue for thesupervisor on the tile 4 in question to automatically pause (causes thefetch stage 14 and scheduler 24 to suspend issuing instructions of thesupervisor). Once all the outstanding worker threads on the local tile 4have performed an EXIT, then the sync logic 39 automatically sends asynchronization request “sync_req” to the synchronization controller 36in the interconnect 34. The local tile 4 then continues to wait with thesupervisor instruction issue paused. A similar process is alsoimplemented on each of the other tiles 4 in the array 6 (each comprisingits own instance of the sync logic 39). Thus at some point, once all thefinal workers in the current compute phase 52 have EXITed on all thetiles 4 in the array 6, the synchronization controller 36 will havereceived a respective synchronization request (sync_req) from all thetiles 4 in the array 6. Only then, in response to receiving the sync_reqfrom every tile 4 in the array 6 on the same chip 2, the synchronizationcontroller 36 sends a synchronization acknowledgement signal “sync_ack”back to the sync logic 39 on each of the tiles 4. Up until this point,each of the tiles 4 has had its supervisor instruction issue pausedwaiting for the synchronization acknowledgment signal (sync_ack). Uponreceiving the sync_ack signal, the sync logic 39 in the tile 4automatically unpauses the supervisor instruction issue for therespective supervisor thread on that tile 4. The supervisor is then freeto proceed with exchanging data with other tiles 4 via the interconnect34 in a subsequent exchange phase 50.

Preferably the sync_req and sync_ack signals are transmitted andreceived to and from the synchronization controller, respectively, viaone or more dedicated sync wires connecting each tile 4 to thesynchronization controller 36 in the interconnect 34.

Furthermore, in accordance with embodiments disclosed herein, anadditional functionality is included in the SYNC instruction. That is,at least when executed in an inter-tile mode (e.g. SYNC chip), the SYNCinstruction also causes the local exit states $LC of each of thesynchronized tiles 4 to be automatically aggregated in further dedicatedhardware 40 in the interconnect 34. In the embodiments shown this logictakes the form of a multi-input AND gate (one input for each tile 4 inthe array 6), e.g. formed from a string of two-input AND gates 40 i, 40ii, . . . as shown by way of example in FIG. 11. This inter-tileaggregation logic 40 receives the value in the local exit state register(local consensus register) $LC 38 from each tile 4 in the array—inembodiments each a single bit—and aggregates them into a single value,e.g. an AND of all the locally aggregated exit states. Thus the logicforms a globally aggregated exit state across all the threads on alltiles 4 in the array 6.

Each of the tiles 4 comprises a respective instance of a globalconsensus register ($GC) 42 arranged to receive and store the globalexit state from the global aggregation logic 40 in the interconnect 34.In embodiments this is another of the status registers in thesupervisor's context register file CXS. In response to thesynchronization request (sync_req) being received from all of the tiles4 in the array 6, the synchronization controller 36 causes the output ofthe aggregation logic 40 (e.g. the output of the AND) to be stored inthe global consensus register ($GC) 42 on each tile 4 (it will beappreciated that the “switch” shown in FIG. 11 is a schematicrepresentation of the functionality and in fact the updating may beimplemented by any suitable digital logic). This register $GC 42 isaccessible by the supervisor thread SV on the respective tile 4 once thesupervisor instruction issue is resumed. In embodiments the globalconsensus register $GC is implemented as a control register in thecontrol register file such that the supervisor thread can get the valuein the global consensus register ($GC) 42 by means of a GET instruction.Note that the synchronization logic 36 waits until the sync_req isreceived from all tiles 4 before updating the value in any of the globalconsensus registers ($GC) 42, otherwise an incorrect value may be madeaccessible to a supervisor thread on a tile that has not yet completedits part of the compute phase 52 and is therefore still running.

The globally aggregated exit state $GC enables the program to determinean overall outcome of parts of the program running on multiple differenttiles 4 without having to individually examine the state of eachindividual worker thread on each individual tile. It can be used for anypurpose desired by the programmer. For instance, in the example shown inFIG. 11 where the global aggregate is a Boolean AND, this means that anyinput being 0 results in an aggregate of 0, but if all the inputs are 1then the aggregate is 1. I.e. if a 1 is used to represent a true orsuccessful outcome, this means that if any of the local exit states ofany of the tiles 4 is false or unsuccessful, then the global aggregatedstate will also be false or represent an unsuccessful outcome. E.g. thiscould be used to determine whether or not the parts of the code runningon all the tiles have all satisfied a predetermined condition. Thus, theprogram can query a single register (in embodiments a single bit) to ask“did anything go wrong? Yes or no?” or “have all nodes in the graphreached an acceptable level of error? Yes or no?, rather than having toexamine the individual states of the individual worker threads on eachindividual tile (and again, in embodiments the supervisor is in fact notable to query the state of the workers except through the exit stateregisters 38, 42). In other words, the EXIT and SYNC instructions eachreduce multiple individual exit states into a single combined state.

In one example use case, the supervisor on one or more of the tiles mayreport to a host processor if the global aggregate indicated a false orunsuccessful outcome. As another example, the program may perform abranch decision depending on the global exit state. For example, theprogram examines the global aggregate exit state $GC and based on thisdetermines whether to continue looping or whether to branch elsewhere.If the global exit state $GC is still false or unsuccessful, the programcontinues iterating the same, first part of the program, but once theglobal exit state $GC is true or successful, the program branches to asecond, different part of the program. The branch decision may beimplemented individually in each supervisor thread, or by one of thesupervisors taking on the role of master and instructing the other,slave supervisors on the other tiles (the master role being configuredin software).

Note that the aggregation logic 40 shown in FIG. 11 is just one example.In another equivalent example, the AND may be replaced with an OR, andthe interpretation of 0 and 1 may be inverted (0→true, 1→false).Equivalently if the AND gate is replaced with an OR gate but theinterpretation of the exit states is not inverted, nor the reset value,then the aggregated state in $GC will record whether any (rather thanall) the tiles exited with locally aggregated state 1. In anotherexample, the global exit state $GC may comprise two bits representing atrinary state: all tiles' locally aggregated exit states $LC were state1, all tiles' locally aggregated exit states $LC were state 0, or thetiles' locally aggregated exit states $LC were mixed. As another morecomplex example, the local exit states of the tiles 4 and the globallyaggregated exit state may each comprise two or more bits, which may beused, for example, to represent a degree of confidence in the results ofthe tiles 4. E.g. the locally aggregated exit state $LC of eachindividual tile may represent a statistical, probabilistic measure ofconfidence in a result of the respective tile 4, and the globalaggregation logic 40 may be replaced with more complex circuitry forperforming a statistical aggregation of the individual confidence levelsin hardware.

As mentioned previously, in embodiments multiple instances of the chip 2can be connected together to form an even larger array of tiles 4spanning multiple chips 2. This is illustrated in FIG. 12. Some or allof the chips 2 may be implemented on the same IC package or some or allof the chips 2 may be implemented on different IC packages. The chips 2are connected together by an external interconnect 72 (via the externallinks 8 shown in FIG. 7). This may connect between chips 2 on the sameIC package, different IC packages on the same card, and/or different ICpackages on different cards. As well as providing a conduit for exchangeof data between tiles 4 on different chips, the external interconnect 72also provides hardware support for performing barrier synchronizationbetween the tiles 4 on different chips 2 and aggregating the local exitstates of the tiles 4 on the different chips 2.

In embodiments, the SYNC instruction can take at least one furtherpossible value of its mode operand to specify an external, i.e.inter-chip, synchronization: SYNC zone_n, wherein zone_n represents anexternal sync zone. The external interconnect 72 comprises similarhardware logic to that described in relation to FIG. 11, but on anexternal, inter-chip scale. When the SYNC instruction is executed withan external sync zone of two or more chips 2 specified in its operand,this causes the logic in the external interconnect 72 to operate in asimilar manner to that described in relation to the internalinterconnect 34, but across the tiles 4 on the multiple different chips2 in the specified sync zone.

That is, in response to the opcode of the SYNC instruction whose operandspecifies an external sync, the execution stage 18 causes the sync levelspecified by the operand to be signalled to dedicated hardware synclogic 76 in the external interconnect 72. In response to this, the synclogic 76 in the external interconnect conducts the process ofsynchronisation request (sync_req) and acknowledgment (sync_ack) to beperformed only amongst all the external tiles 4 to which, e.g. all thetiles across all chips 2 in the system for a global sync. I.e. the synclogic 76 in the external interconnect 72 will return the syncacknowledgment signal (sync_ack) to the tiles 4 across chips 2 only oncea synchronization request (sync_req) has been received from all thetiles 4 from those chips. All the tiles 4 on all those chips 2 will beautomatically paused until the sync acknowledgment (sycn_ack) from theexternal sync logic 76 is returned.

Thus, in response to an external SYNC, the supervisor instruction issueis paused until all tiles 4 on all chips 2 in the external sync zonehave completed their compute phase 52 and submitted a sync request.Further, logic in the external interconnect 72 aggregates the local exitstates of all these tiles 4, across the multiple chips 2 in the zone inquestion. Once all tiles 4 in the external sync zone have made the syncrequest, the external interconnect 72 signals a sync acknowledgment backto the tiles 4 and stores the cross-chip global aggregate exit stateinto the global consensus registers ($GC) 42 of all the tiles 4 inquestion. In response to the sync acknowledgement, the tiles 4 on allthe chips 2 in the zone resume instruction issue for the supervisor.

Note that in embodiments the functionality of the interconnect 72 may beimplemented in the chips 2, i.e. the logic may be distributed among thechips 2 such that only wired connections between chips are required(FIGS. 11 and 12 are schematic).

All tiles 4 within the mentioned sync zone are programmed to indicatethe same sync zone via the mode operand of their respective SYNCinstructions. In embodiments the sync logic 76 in the externalinterconnect 72 peripheral is configured such that, if this is not thecase due to a programming error or other error (such as a memory parityerror), then some or all tiles 4 will not receive an acknowledgement,and therefore that the system will come to a halt at the next externalbarrier, thus allowing a managing external CPU (e.g. the host) tointervene for debug or system recovery. Preferably however the compileris configured to ensure the tiles in the same zone all indicate thesame, correct sync zone at the relevant time. The sync logic may also beconfigured to take other alternative or additional measures in event ofinconsistency in the modes indicated by the different SYNC instruction,e.g. raising an exception to the external CPU, and/or halting executionby some other mechanism.

As illustrated in FIG. 14, in embodiments the mode of the SYNCinstruction can be used to specify one of multiple different possibleexternal sync zones, e.g. zone_1 or zone_2. In embodiments thesecorrespond to different hierarchical levels. That is to say, each higherhierarchical level 92 (e.g. zone 2) encompasses two or more zones 91A,91B of at least one lower hierarchical level. In embodiments there arejust two hierarchical levels, but higher numbers of nested levels arenot excluded. If the operand of the SYNC instruction is set to the lowerhierarchical level of external sync zone (SYNC zone_1), then theabove-described sync and aggregation operations are performed inrelation to the tiles 4 on the chips 2 in only the same lower-levelexternal sync zone as the tile on which the SYNC was executed. If on theother hand the operand of the SYNC instruction is set to the higherhierarchical level of external sync zone (SYNC zone_2), then theabove-described sync and aggregation operations are automaticallyperformed in relation to all the tiles 4 on all the chips 2 in the samehigher-level external sync zone as the tile on which the SYNC wasexecuted.

In response to the opcode of the SYNC instruction having an externalsync zone as an operand, the execution stage 18 causes the sync levelspecified by the operand to be signalled to dedicated hardware synclogic 76 in the external interconnect 72. In response to this, the synclogic 76 in the external interconnect conducts the process ofsynchronisation request (sync_req) and acknowledgment (sync_ack) to beperformed only amongst the tiles 4 of the signalled group. I.e. the synclogic 76 in the external interconnect 72 will return the syncacknowledgment signal (sync_ack) to the tiles in the signalled sync zoneonly once a synchronization request (sync_req) has been received fromall the tiles 4 in that zone (but will not wait for any other tilesoutside that zone if it is not a global sync).

Note that in other embodiments, the sync zones that can be specified bythe mode of the SYNC instruction are not limited to being hierarchicalin nature. In general, a SYNC instruction may be provided with modescorresponding to any kind of grouping. For instance, the modes mayenable selection from amongst only non-hierarchical groups, or a mixtureof hierarchical groupings and one or more non-hierarchical groups (whereat least one group is not entirely nested within another). Thisadvantageously enables the flexibility for the programmer or compiler,with minimal code density, to select between different layouts ofinternally-synchronous groups that are asynchronous with respect to oneanother.

An example mechanism for implementing the synchronization amongst theselected sync group 91, 92 is illustrated in FIG. 18. As illustrated,the external sync logic 76 in the external interconnect 72 comprisesrespective sync block 95 associated with each respective chip 2. Eachsync block 95 comprises respective gating logic and a respective syncaggregator. The gating logic comprises hardware circuitry which connectstogether the chips 2 in a daisy chain topology for the purpose ofsynchronization and exit state aggregation, and which propagates thesync and exit state information in accordance with the following.

The sync aggregator comprises hardware circuitry configured to aggregatethe synchronization requests (sync_req) and the exit states inaccordance with the following.

The respective sync block 95 associated with each chip 2 is connected toits respective chip 2, such that it can detect the sync request(Sync_req) raised by that chip 2 and the exit state of that chip 2, andso that it can return the sync acknowledgment (Sync_ack) and global exitstate to the respective chip 2. The respective sync block 95 associatedwith each chip 2 is also connected to the sync block 95 of at least oneother of the chips 2 via an external sync interface comprising a bundleof four sync wires 96, details of which will be discussed in moredetailed shortly. This may be part of one of the chip-to-chip links 8.In the case of a link between chips on different cards, the interface 8may for example comprise a PCI interface and the four sync wires 96 maybe implemented by re-using four wires of the PCI interface. Some of thechips' sync blocks 95 are connected to that of two adjacent chips 2,each connection via a respective instance of the four sync wires 96.This way, the chips 2 can be connected in one or more daisy chains viatheir sync blocks 95. This enables the sync requests, syncacknowledgments, running aggregates of exit states, and global exitstates, to be propagated up and down the chain.

In operation, for each sync group 91, 92, the sync block 95 associatedwith one of the chips 2 in that group is set as the master forsynchronization and exit state aggregation purposes, the rest in thegroup being slaves for this purpose. Each of the slave sync blocks 95 isconfigured with the direction (e.g. left or right) that it needs topropagate sync requests, sync acknowledgments and exit states for eachsync group 91, 92 (i.e. the direction toward the master). In embodimentsthese settings are configurable by software, e.g. in an initialconfiguration phase after which the configuration remains set throughoutthe subsequent operation of the system. For instance this may beconfigured by the host processor. Alternatively it is not excluded thatthe configuration could be hard-wired. Either way, the different syncgroups 91, 92 can have different masters and in general it is possiblefor a given chip 2 (or rather its sync block 95) to be master of onegroup and not another group of which it is a member, or to be master ofmultiple groups.

For instance, by way of illustration consider the example scenario ofFIG. 18. Say for the sake of example that the sync block 95 of chip 21Vis set as the master of a given sync group 91A. Consider now the firstchip 2I in the chain of chips 2, connected via their sync blocks 95 andwires 96 ultimately to chip 2IV. When all the worker threads of thecurrent compute phase on the first chip 2I have executed an EXITinstruction, and the supervisors on all the (participating) tiles 4 haveall executed a SYNC instruction specifying the sync group 91A, then thefirst chip 2I signals its sync readiness to its respective associatedsync block 95. The chip 2I also outputs to its respective sync block 95its chip-level aggregated exit state (the aggregate of all the exitingworkers on all the participating tiles on the respective chip 2I). Inresponse, the sync block 95 of the first chip 2I propagates a syncrequest (Sync_req) to the sync block 95 of the next chip 2II in thechain. It also propagates the exit state of the first chip 2I to thesync block 95 of this next chip 2II. The sync block 95 of this secondchip 2II waits until the supervisors of its own (participating) tiles 4have all executed a SYNC instruction specifying the sync group 91A,causing the second chip 2II to signal sync readiness. Only then does thesecond chip's sync block 95 propagate a sync request to the sync block95 of the next (third) chip 2III in the chain, and also propagates arunning aggregate of the exit state of the first chip 2I with that ofthe second 2II. If the second chip 2II had become sync ready before thefirst 2I, then the sync block 95 of the second chip 2II would havewaited for the first chip 2I to signal a sync request before propagatingthe sync request to the sync block 95 of the third chip 2III. The syncblock 95 of the third chip 2III behaves in a similar manner, this timeaggregating the running aggregate exit state from the second chip 2II toobtain the next running aggregate to pass onwards, etc. This continuestoward the master sync block, that of chip 2IV in this example.

The sync block 95 of the master then determines a global aggregate ofall the exit states based on the running aggregate it receives and theexit state of its own chip 2IV. It propagates this global aggregate backout along the chain to all the chips 2, along with the syncacknowledgement (Sync_ack).

If the master is part way along a chain, as opposed to being at one endas in the above example, then the sync and exit state informationpropagates in opposite directions either side of the master, both sidestoward the master. In this case the master only issues the syncacknowledgment and global exit state once the sync request from bothsides has been received. E.g. consider the case where chip 2III ismaster of group 92. Further, in embodiments the sync block 95 of some ofthe chips 2 could connect to that of three or more other chips 2, thuscreating multiple branches of chains toward the master. Each chain thenbehaves as described above, and the master only issues the syncacknowledgment and global exit state once the sync request from allchains has been received. And/or, one or more of the chips 2 couldconnect to an external resource such as the host processor, a networkcard, a storage device or an FPGA.

In embodiments the signalling of the sync and exit state information isimplemented as follows. The bundle of four sync wires 96 between eachpair of chips 2 comprises two pairs of wires, a first pair 96_0 and asecond pair 96_1. Each pair comprises an instance of a sync request wireand an instance of a sync acknowledgment wire. To signal a runningaggregate exit state of value 0, the sync block 95 of the sending chip 2uses the sync request wire of the first wire pair 96_0 when signallingthe sync request (sync_req), or to signal a running aggregate of value 1the sync block 95 uses the sync request wire of the second wire pair96_1 when signalling the sync request. To signal a global aggregate exitstate of value 0, the sync block 95 of the sending chip 2 uses the syncacknowledgment wire of the first wire pair 96_0 when signalling the syncacknowledgment (sync_ack), or to signal a global aggregate of value 1the sync block 95 uses the sync request wire of the second wire pair96_1 when signalling the sync acknowledgment.

Note that the above is only the mechanism for propagating sync and exitstate information. The actual data (content) is transmitted by anotherchannel, for example as discussed later with reference to FIG. 19.Further, it will be appreciated that this is only one exampleimplementation, and the skilled person will be capable of building othercircuits for implementing the disclosed synchronization and aggregationfunctionality once given the specification of that functionalitydisclosed herein. For instance, the synchronisation logic (95 in FIG.18) could instead use packets carried over the interconnect 34, 72 as analternative to dedicated wiring. E.g. the sync_req and/or the sync_ackcould each be transmitted in the form of one or more packets.

As mentioned previously, not all tiles 4 need necessarily participate inthe synchronization. In embodiments, as discussed, the group ofparticipating tiles can be set by the mode operand of the syncinstruction. However, this only allows for selection of predefinedgroups of tiles. It is recognized herein that it would also be desirableto be able to select sync participation on a tile-by-tile basis.Therefore in embodiments, there is provided an alternative or additionalmechanism for selecting which individual tiles 4 participate in thebarrier synchronization.

Particularly, this is achieved by providing an additional type ofinstruction in the processor instruction set, to be executed by one orsome tiles 4 in place of the SYNC instruction. This instruction may bereferred to as the “abstain” instruction, or “SANS” instruction (startautomatic non-participatory sync). In embodiments the SANS is reservedfor use by the supervisor thread. In embodiments it takes a singleimmediate operand:

SANS n_barriers

The behaviour of the SANS instruction is to cause the tile on which itis executed to abstain from the current barrier synchronization, butwithout holding up the other tiles which are waiting for all tiles inthe specified sync group to SYNC. In effect it says “go on without me”.When the SANS instruction is executed, the opcode of the SANSinstruction triggers the logic in the execution unit of the executionstage 18 to send an instance of the synchronization request signal(Sync_req) to the internal and/or external sync controller 36, 76(depending on the mode). In embodiments, the sync request generated bythe SANS applies to any sync group 91, 92 that encompass the tile 4 thatexecuted the SANS. I.e. for whatever sync group the tiles 4 in thislocal chip or chips are using next (they must agree on the sync group),the sync_req from those that have executed SANS will always be valid.

Thus from the perspective of the sync controller logic 36, 76 and theother tiles 4 in the sync group, the tile 4 executing the SANSinstruction appears exactly as a tile 4 executing a SYNC instruction,and does not hold up the sync barrier and the sending of the syncacknowledgment signal (Sync_ack) from the sync logic 36, 76. I.e. thetiles 4 executing the SANS instead of the SYNC does not hold up or stallany of the other tiles 4 involved any sync group of which the tile inquestion is otherwise a member. Any handshake performed by a SANS isvalid for all sync groups 91, 92.

However, unlike the SYNC instruction, the SANS instruction does notcause supervisor instruction issue to be paused awaiting the syncacknowledgment signal (Sync_ack) from the sync logic 36, 76. Instead therespective tile can simply continue uninhibited by the current barriersynchronization that is being conducted between the other tiles 4 thatexecuted SYNC instructions. Thus by mimicking a sync but not waiting,the SANS instruction allows its tile 4 to press on with processing oneor more tasks whilst still allowing the other tiles 4 to sync.

The operand n_barriers specifies the number of “posted” syncs, i.e. thenumber of future sync points (barriers) the tile will not beparticipating in. Alternatively it is not excluded that in otherembodiments the SANS instruction does not take this operand, and insteadeach execution of the SANS instruction causes only a one-off abstention.

By means of the SANS instruction, certain tiles 4 may be responsible forperforming tasks outside the direct scope of the BSP operating schedule.For example, it may be desirable to allocate a small number of tiles 4within a chip 2 to initiate (and process) data transfers to and/or fromhost memory while the majority of tiles 4 are occupied with the primarycomputation task(s). In such scenarios those tiles 4 not directlyinvolved with primary computation can declare themselves as effectivelydisconnected from the synchronization mechanism for a period of timeusing the automatic non-participatory sync feature (SANS). When usingthis feature, a tile 4 is not required to actively (i.e. via executionof the SYNC instruction) signal its readiness for synchronization (forany of the synchronization zones), and in embodiments makes a nullcontribution to the aggregated exit status.

The SANS instruction begins or extends a period during which the tile 4on which it is executed will abstain from active participation ininter-tile synchronization (or synchronization with other externalresources if they are also involved in the synchronization). During thisperiod, this tile 4 will automatically signal its readiness forsynchronization, within all zones, and in embodiments also make a nullcontribution to the global aggregated consensus $GC. This time periodmay be expressed as an unsigned immediate operand (n_barriers)indicating how many additional future synchronization points will beautomatically signalled by this tile 4. Upon execution of the SANS, thevalue n_barriers specified by its operand is placed into a countdownregister $ANS_DCOUNT on the respective tile 4. This is a piece ofarchitectural state used to keep a track of how many additional futuresync_reqs should be made. If the automatic non-participatory syncmechanism is currently inactive, the first assertion of readiness (syncrequest, sync_req) will be performed immediately. Subsequent assertionswill occur in the background, once the previous synchronization hascompleted (i.e. following assertion of the sync acknowledgment,sync_ack). If the automatic non-participatory sync mechanism iscurrently active, the countdown counter register $ANS_DCOUNT will beupdated in an automatic manner, such that no sync acknowledgment signalis left unaccounted for. The automatic non-participatory sync mechanismis implemented in dedicated hardware logic, preferably an instance of itin each tile 4, though in other embodiments it is not excluded that itcould instead be implemented centrally for a group of tiles or alltiles.

With regard to the exit state behaviour, there are in fact a number ofpossibilities depending on implementation. In embodiments, to obtain theglobally aggregated exit state, the sync logic 36, 76 only aggregatesthe local exit states from those tiles 4 in the specified sync groupthat executed a SYNC instruction, and not those that/those that executeda SANS instruction (the abstaining tile or tiles). Alternatively, theglobally aggregated exit state is obtained by aggregating the local exitstates from all the tiles 4 in the sync group that executed a SYNC andthose that executed a SANS (both the participating and abstaining tiles4). In the latter case, the local exit state output by the abstainingtile(s) 4 for global aggregation may be the actual locally aggregatedexit state of that tile's workers at the time of executing the SANS,just as with the SYNC instruction (see description of local consensusregister $LC 38). Alternatively the local “exit state” output by theabstaining tile 4 may be a default value, for instance the true value(e.g. logic 1) in embodiments where the exit state is binary. Thisprevents the abstaining tile 4 from interfering with the global exitstate in embodiments where any false local exit state causes the globalexit state to be false.

Regarding the return of the global exit state, there are twopossibilities for this, regardless of whether or not the abstaining tilesubmits a local exit state for producing the global aggregate, andregardless of whether that value was an actual value or a default value.That is, in one implementation, the global aggregate exit state producedby the sync logic 36, 76 in the interconnect 34, 72 is stored only inthe global consensus registers $GC 42 of the participating tiles 4,which executed a SYNC instruction, and not the abstaining tiles 4 whichinstead executed a SANS instruction. In embodiments, instead a defaultvalue is stored in the global consensus register $GX 42 of the tile(s) 4that executed a SANS (the abstaining tiles). For instance this defaultvalue may be true, e.g. logic 1, in the case of a binary global exitstate. In an alternative implementation however, the actual globalaggregate produced by the sync logic 36, 76 is stored in the globalconsensus registers $GC 42 of both the participating tiles 4 whichexecuted SYNC instructions and the abstaining tiles 4 which insteadexecuted a SANS instruction. Thus all tiles in the group may still haveaccess to the globally aggregated exit state.

FIG. 13 illustrates an example BSP program flow involving both internal(on-chip) and external (inter-chip) synchronizations. As shown, the flowcomprises internal exchanges 50 (of data between tiles 4 on the samechip 2) and the external exchanges 50′ (of data between tiles 4 ondifferent chips 2).

As illustrated in FIG. 13, according to the present disclosure it isdisclosed to keep the internal BSP supersteps (comprising the internalexchanges 50 of data between tiles 4 on the same chip 2) separate fromthe external sync and exchange (comprising the external exchanges 50′ ofdata between tiles 4 on different chips 2).

One reason to keep internal and external BSP separate is that, inembodiments, exchange of data via the internal (on-chip) interconnect 34can be made time deterministic, as will be discussed in more detailshortly with reference to FIGS. 16 and 17; whereas exchange of data viaan external interconnect 72 may be non-time-deterministic, e.g. due to alossy physical channel which will require retransmission of messages. Ingeneral an external interconnect could be made time-deterministic but itmay be difficult to do so or might confer too little advantage over anon-deterministic interconnect, and so may not be implemented inpractice.

In such embodiments, it would be desirable to keep the internalcommunications time deterministic so that they can be conducted withoutthe need for queues in the internal interconnect 34, since queues wouldincur an undesirable silicon footprint in the interconnect 34. However,in embodiments external communications may not be time deterministic. Ifevery BSP superstep was a global exchange, then the time determinismwould be “contaminated” by the non-time deterministic externalexchanges. This is because once a given tile or thread has performed anexternal exchange, then the time determinism is lost and cannot berecovered until the next barrier synchronization.

As will be discussed in more detail shortly, the communication withoutqueues can be achieved by the compiler knowing the time at which eachtile 4 transmits its data, and also knowing the on-chip inter-tile delaybetween the transmitting and receiving tile. Given this predeterminedknowledge, the compiler can then program the receiving tile to listen tothe address of the transmitting tile at a specific, known time after thetransmission of the relevant data by the transmitting tile, i.e. thetransmit time plus the inter-tile delay. The timing of the transmissionis known by the compiler because the compiler itself selects at whichpoint in each thread to include the send instruction(s). Further, theinter-tile delay, for on-chip communications, is a fixed knowable valuefor a given pair of transmitting and receiving tiles 4. The compiler mayknow this from a look-up table of inter-tile delays for differentpossible combinations of sending and receiving tiles. The compiler canthen include the corresponding receive instruction, to listen to thesender's address, at the corresponding number of cycles after thetransmit instruction.

Another reason to separate the BSP into internal and external stages isthat a global synchronization and exchange across multiple chips will bemore “expensive” than for only an on-chip synchronization and exchangewith the total cost being that of the aforementioned dinternalsynchronization plus the additional delays required to aggregate thisglobally. Further, though in embodiments the sync signalling itself doesnot require flow control and is therefore relatively fast, the externalsynchronization syncs into an external exchange. An external exchangeexperiences longer latency and greater uncertainty versus an internalone.

Firstly, there is usually much less data bandwidth available inter-chipthan on-chip. This is because inter-chip wiring density is limited bypackage connection (ball or pad) density which is much lower than thewiring density available on chip. So communicating a fixed amount ofdata between chips will take much longer than on-chip, even iftransmission delays are similar. Also, external exchange is less local:wires reach further and hence are more capacitive, and more vulnerableto noise. This in turn may result in loss and hence the need for flowcontrol mechanism which provides for retransmission at the physicallayer, leading to reduced throughput (and loss of time determinism—seebelow). Further, as well as a greater physical distance, signalling anddata transmitted between chips typically has to traverse greater amountof logic such as SerDes (serializers-deserializers) and flow controlmechanisms, all of which adds extra delay compared to internalcommunications. For instance, the inventors have identified that usingconventional technologies, an external barrier synchronization processcan be expected to take of the order of ten times longer than aninternal synchronization, and may account for 5-10% of the programrunning time. Using the hardware synchronization mechanism disclosedherein this can be reduced to the order of three times slower, but isstill slower than an internal synchronization. Further, the exchange ofdata externally will, e.g. due to factors such as loss andretransmission at the physical layer due to noise, and/or serializationand deserialization between chips.

In other variants the interconnect between chips may be lossless at thephysical and/or link layer, but is actually lossy at the highernetworking layer due to contention of network layer flows betweendifferent sources and destinations causing queues to be over-flowed andpackets dropped. This is how Ethernet works and it is envisaged that analternative non-time-deterministic interconnect may employ Ethernet.Note also: it is the case that any exchange process, whether lossless orlossy, can actually suffer unrecoverable errors (e.g. due to alpharadiation) which result in total exchange failure and which cannot berecovered by any hardware mechanism (e.g. link layer). In both thetime-deterministic cases and non-time-deterministic cases, inembodiments the system may detect but not correct such errors. Oncedetected, the error may be signalled to the host, whose strategy may beto require that the BSP application state be periodically checkpointedand in the event of such a fatal hardware error, rollback the state ofthe application to the last checkpoint. By this mechanism, even lossymechanisms used to effect data exchanges can be made to appear losslessto the user, at some performance cost.

For any one or more of the above reasons or others, it would bedesirable to separate the BSP process into time-deterministic andnon-time-deterministic stages, so as to prevent the time determinism ofat least some of the time-deterministic exchanges withintime-deterministic domains from being contaminated by the non-timedeterministic exchanges between such domains.

Accordingly, the program may be arranged to perform a sequence ofsynchronizations, exchange phases and compute phases comprising in thefollowing order: (i) a first compute phase, then (ii) an internalbarrier synchronization 30, then (iii) an internal exchange phase 50,then (iv) an external barrier synchronization 80, then (v) an externalexchange phase 50′.

See chip 2II in FIG. 13. The external barrier 80 is imposed after theinternal exchange phase 50, such that the program only proceeds to theexternal exchange 50′ after the internal exchange 50. Note also that asshown with respect to chip 2I in FIG. 12, optionally a compute phase maybe included between internal exchange (iii) and external barrier (iv).

This overall sequence is enforced by the program (e.g. being generatedas such by the compiler). In embodiments the program is programmed toact in this way by means of the SYNC instruction described previously.The internal synchronization and exchange does not extend to any tilesor other entities on another chip 2. The sequence (i)-(v) (with theaforementioned optional compute phase between iii and iv) may berepeated in a series of overall iterations. Per iteration there may bemultiple instances of the internal compute, sync and exchange (i)-(iii)prior to the external sync & exchange. I.e. multiple instances of(i)-(iii) (retaining that order), i.e. multiple internal BSP supersteps,may be implemented before (iv)-(v), i.e. the external sync and exchange.Note also, any of the tiles 4 may each be performing their own instanceof the internal synchronization and exchange (ii)-(iii) in parallel withthe other tiles 4.

Thus per overall BSP cycle (i)-(v) there is ensured to be at least onepart of the cycle (ii)-(iii) wherein synchronization is constrained tobeing performed only internally, i.e. only on-chip.

Note that during an external exchange 50 the communications are notlimited to being only external: some tiles may just perform internalexchanges, some may only perform external exchanges, and some mayperform a mix. However, due to the loss of time determinism that occursin the external interconnect 72 in some embodiments, then in suchembodiments, once a tile has performed an external communication itcannot perform an internal communication again until the nextsynchronization (see below explanation of the preferred on-chipcommunication mechanism which relies on predetermined knowledge ofmessage timing and inter-tile delays).

In some embodiments, also as shown in FIG. 13, some tiles 4 may performlocal input/output during a compute phase, for example they may exchangedata with a host.

Note also that as shown in FIG. 13, it is in general possible for any orall tiles to have a null compute phase 52 or a null exchange phase 50 inany given BSP superstep.

In embodiments, the different levels of sync zones 91, 92 may be used toconstrain the extent of some of the external sync & exchange operationsto only a subgroup of the chips 2 in the system, and limit the number oftimes the penalty of a full, global sync and exchange is needed. Thatis, the overall cycle may comprise: (i) a first compute phase, then (ii)an internal barrier synchronization, then (iii) an internal exchangephase, then (iv) an external barrier synchronization 80 within the tilesof only a first, lower level sync zone 91; then (v) an external exchangephase between only the chips of the first sync zone 91; then (vi) anexternal barrier synchronization across a second, higher level sync zone92; then (vii) an external exchange phase amongst the chips of thesecond level sync zone 92. The external barrier to the second levelexchange phase is imposed after the first level external exchange phase,such that the program only proceeds to the second level externalexchange after the first level exchange phase. This behaviour may beprogrammed by using the SYNC instruction qualified by different levelsof the external mode in its operand.

In embodiments the highest hierarchical level of sync zone encompassesall the tiles 4 on all chips 2 in the array 6, i.e. it is used toperform a global sync. When multiple lower-level zones are used, BSP maybe imposed internally amongst the group of tiles 4 on the chip(s) 2within each zone, but each zone may operate asynchronously with respectto one another until a global sync is performed.

Note: with regard to the lower-level external synchronization andexchange (iv)-(v), any of the lower-level zones 91A, 91B may each beperforming its own instance of the lower-level external exchange inparallel with the other lower-level zone(s). And/or, in some casesmultiple instances of (i)-(v) may be implemented before (vi)-(vii), i.e.there may be multiple instances of the lower-level external BSPsuperstep before the external sync and exchange. Further, the schemecould be extended to three or more hierarchical levels of sync zone.

The following describes an exemplary mechanism for communicating on-chip(internal exchange) without the need for queues. Reference is made toFIG. 16.

On each chip 2, the chip 2 comprises a respective clock which controlsthe timing of chip activity. The clock is connected to all of the chip'scircuits and components. The chip 2 also comprises the internal,time-deterministic interconnect or “switching fabric” 34 to which alltiles and links are connected by sets of connection wires. Inembodiments the interconnect 34 may be stateless, in that it has nostate readable by software. Each set of connection wires is fixed end toend. The wires are pipelined. In this embodiment, a set comprisesthirty-two wires. Each set can carry a packet consisting of one or more32-bit datums, with one datum being transferred per clock cycle. Butnote herein that the word “packet” denotes a set of bits representing adatum (sometimes referred to herein as a data item), perhaps with one ormore valid bit. The “packets” do not have headers or any form ofdestination identifier (which permits an intended recipient to beuniquely identified), nor do they have end-of-packet information.Instead, they each represent a numerical value input to or output from atile. Each tile has its own local memory (described later). The chip hasno shared memory. The switching fabric constitutes a cross set ofconnection wires only and also does not hold any state. Data exchangebetween tiles on the same chip is conducted on a time deterministicbasis as described herein. A pipelined connection wire comprises aseries of temporary stores, e.g. latches or flip flops which hold datumfor a clock cycle before releasing it to the next store. Time of travelalong the wire is determined by these temporary stores, each one usingup a clock cycle of time in a path between any two points.

Each tile 4 indicates its synchronisation state to the sync controller36 in the internal interconnect 34. Once it has been established thateach tile 4 is ready to send data, the synchronisation process 30 causesthe system to enter the exchange phase 50. Note that each tileexperiences the sync-ack with a different but known time delay. Thesupervisor program inserts additional cycle delays as required such thateach tile begins its exchange phase on the exact same cycle. In thisexchange phase, data values move between tiles (in fact between thememories of tiles in a memory-to-memory data movement). In the exchangephase, there are no computations and therefore no concurrency hazards(or at least there are no computations that reply on data yet to bereceived from another tile 4). In the exchange phase, each datum movesalong the connection wires on which it exits a tile from a transmittingtile to its recipient tile. At each clock cycle, datum moves a certaindistance along its path (store to store), in a pipelined fashion. When adatum is issued from a tile, it is not issued with a header identifyinga recipient tile. Instead, the recipient tile knows that it will beexpecting a datum from a certain transmitting tile at a certain time.Thus, the computer described herein is time deterministic.

Each tile 4 runs a portion of the program which has been allocated to itby the programmer or by a compiler exercise, where the programmer or thecompiler function has knowledge of what will be transmitted by aparticular tile at a certain time and what needs to be received by arecipient tile at a certain time. In order to achieve this, SENDinstructions are included in the local programs executed by theprocessor on each tile, where the time of execution of the SENDinstruction is predetermined relative to the timing of otherinstructions being executed on other tiles in the computer.

Each tile 4 is associated with its own multiplexer 210. Each multiplexerhas at least as many inputs as there are tile 4 on the chip, each inputbeing connected to the switching fabric 34. The cross wires of theswitching fabric are connected to a data-out set of connection wires 218from each tile (a broadcast exchange bus). For ease of illustration, notall crosswire are shown in FIG. 16. One set of crosswires is labelled140 x to indicate that it is one of a number of sets of crosswires.

When the multiplexer 210 is switched to the input labelled 220 x thenthat will connect to the crosswires 140 x and thus to the data bus 218Tof the transmitting (sending) tile 4T. If the multiplexer is controlledto switch to that input at a certain time, then the datum received onthe data bus 230 which is connected to the crosswire 140 x will appearat the output of the multiplexer 210 at a certain time. It will arriveat the receiving tile 4R a certain delay after that, the delay dependingon the distance of the multiplexer 210 from the receiving tile 4R. Asthe multiplexers tend to be arranged close to the switching fabric, thedelay from the tile to the multiplexer can vary depending on thelocation of the receiving tile 4R.

To implement the switching, the local programs executed on the tiles 4include switch control instructions (PUTi) which cause a multiplexercontrol signal 214 to be issued to control the multiplexer 210associated with that tile to switch its input at a certain time ahead ofthe time at which a particular datum is expected to be received at thetile. In the exchange phase, multiplexers are switched and packets(data) are exchanged between tiles using the switching fabric. It can beseen from this explanation that the internal interconnect 34 has nostate and requires no queues—the movement of each datum is predeterminedby the particular crosswire to which the input of each multiplexer isconnected.

In the exchange phase, all tiles 4 are permitted to communicate with allother tiles within its sync group. Each tile 4 has control of its ownunique input multiplexer 210. Incoming traffic can thus be selected fromany other tile in the chip 2 (or from one of the external connectionlinks in an external exchange). It is also possible for a multiplexer210 to be set to receive a null input, i.e. no input, in any givenexchange phase.

Each tile 4 has three interfaces: an “exin” interface 224 which passesdata from the switching fabric 34 to the tile 4; an “exout” interface226 which passes data from the tile to the switching fabric over thebroadcast exchange bus 218; and an “exmux” interface 228 which passesthe control mux signal 214 (mux-select) from the tile 4 to itsmultiplexer 210.

In order to ensure each individual tile executes SEND instructions andswitch control instructions at appropriate times to transmit and receivethe correct data, exchange scheduling requirements need to be met by theprogrammer or compiler that allocates individual programs to theindividual tiles in the computer. This function is carried out by anexchange scheduler, preferably at compile time, which needs to be awareof the following parameters.

Parameter I: the relative SYNC acknowledgement delay of each tile, RSAK(TID sending tile, TID receiving tile). This is a function of tile ID(TID) of the sending and receiving tiles, which is held in the TILE_IDregister. This is a number of cycles always greater than or equal to 0indicating when each tile receives the sync ack signal from the synccontroller 36 relative to all other tiles. This can be calculated fromthe tile ID, noting that the tile ID indicates the particular locationon the chip of that tile, and therefore reflects the physical distances.Put another way, the sync ack delays are equalized. If the transmittedtile 4T is closer to the sync controller 36 and the receiving tile 4R isfurther away, the consequence is that the sync acknowledgement delaywill be shorter to the transmitting tile 4T than for the receiving tile4R, and vice versa. A particular value will be associated with each tilefor the sync acknowledgement delay. These values can be held for examplein a delay table, or can be calculated on the fly each time based on thetile ID.

Parameter II: the exchange mux control loop delay, MXP (TID of receivingtile). This is the number of cycles between issuing an instruction (PUTiMUXptr) that changes a tile's input mux selection and the earliest pointat which the same tile could issue a (hypothetical) load instruction forexchange data stored in memory as a result of the new mux selection.This comprises the delay of the control signal getting from the exmuxinterface 228R of recipients tile 4R to its multiplexer 210R and thelength of the line from the output of the multiplexer to the data inputexin interface 224.

Parameter III: the tile to tile exchange delay, TT (TID of sending tile,TID of receiving tile). This is the number of cycles between a SENDinstruction being issued on one tile and the earliest point at which thereceiving tile could issue a (hypothetical) load instruction pointing tothe sent value in its own memory. This can be calculated from the TIDsof the sending and receiving tiles, either by accessing a table, or bycalculating on the fly. This delay includes the time taken for data totravel from transmit tile 4T from its exout interface 226T to theswitching fabric 14 along its exchange bus 218T and then via the inputmux 210R at the receiving tile 4R to the ex in interface 224R of thereceiving tile.

Parameter IV: the exchange traffic memory pointer update delay, MMP( )This is the number of cycles between issuing an instruction (PUTiMEMptr) that changes a tile's exchange input traffic memory pointer 232and the earliest point at which that same tile could issue a(hypothetical) load instruction for exchange data stored in memory as aresult of the new pointer. This is a small, fixed number of cycles. Thememory pointer 232 acts as a pointer into the data memory 202 andindicates where incoming data from the exin interface 224 is to bestored.

Together these parameters give the total inter-tile delay that will beexperienced between transmission of a datum from the transmitting tile4T and receipt of that datum by the receiving tile 4R. The particularexchange mechanism and parameters above are given only by way ofexample. Different exchange mechanisms may differ in the exactcomposition of the delay, but as long as the exchange is kept timedeterministic, then it can be known by the programmer or compiler andthus exchange without queues is possible.

FIG. 17 shows the example exchange timings in more depth. On theleft-hand side are shown the chip clock cycles running from 0-30. Actionon the sending tile 4T occurs between clock cycles 0 and 9, startingwith issuance of a send instruction (SEND E0). In clock cycles 10through 24, the datum pipelines its way through the switching fabric 34.

Looking at the receiving tile 4R in IPU clock cycle 11 a PUTiinstruction is executed that changes the tile input mux selection. Incycle 18, the memory pointer instruction is executed allowing for a loadinstruction in clock cycle 25. On the sending tile 4T, cycles 1 to 9 arean internal tile delay between the issuance of a SEND instruction andthe manifestation of that data on the exout interface. E1, E2 etc.denote datum from earlier SEND instructor. In the exchange fabric 34,clock cycles 10 through 24 are labelled “exchange”. In each of thesecycles, a datum moves “one step” along the pipeline (between temporarystores). Cycles 25-29 on the recipient tile 4R denote the delay betweenreceiving a datum at the exin interface and encoding it into memory.

In simple terms, if the processor of the receiving tile 4R wants to acton a datum which was the output of a process on the transmitting tile4T, then the transmitting tile 4T has to execute a SEND instruction sendat a certain time (e.g. clock cycle 0 in FIG. 17), and the receivingtile 4R has to execute a switch control instruction PUTi EXCH MXptr (asin clock cycle 11) by a certain time relative to the execution of theSEND instruction on the transmitting tile. This will ensure that thedata arrives at the recipient tile in time to be loaded for use in acode-let being executed at the recipient tile 4R.

Note that the receive process at a recipient tile does not need toinvolve setting the memory pointer as with instruction PUTi MEMptr.Instead, the memory pointer 232 automatically increments after eachdatum is received at the exin interface 224. Received data is then justloaded into the next available memory location. However, the ability tochange the memory pointer enables the recipient tile to alter the memorylocation at which the datum is written. All of this can be determined bythe compiler or programmer who writes the individual programs to theindividual tiles such that they properly communicate. This results inthe timing of an internal exchange (the inter-tile exchange on chip) tobe completely time deterministic. This time determinism can be used bythe exchange scheduler to highly optimise exchange sequences.

FIG. 19 illustrates an exemplary mechanism for communicating off-chip(external exchange). This mechanism is non-time-deterministic. Themechanism is implemented in dedicated hardware logic in the externalinterconnect 72. Data is sent over the external interconnect 72 in theform of packets. Unlike the packets sent over the internal interconnect,these packets have headers: as the order of transmission can change,they require the destination address to be present in the packet header.Also in embodiments the external interconnect 72 takes the form of anetwork and therefore requires additional information for routingpurposes.

At the physical layer the interconnect mechanism is lossy, but at thetransaction layer the mechanism is not lossy due to the architecture ofthe link layer: if a packet is not acknowledged it will be resentautomatically by the hardware in the interconnect 72. The possibilityfor loss and resending at the data link layer however means that thedelivery of data packets over the external interconnect is nottime-deterministic. Further, all the packets of a given exchange mayarrive together or separated apart in time, and in any order, so theexternal interconnect requires flow control and queuing. Further, theinterconnect may use clock-data-recovery (CDR) technology to infer aclock from a received data stream having sufficient data signaltransitions to maintain bit-lock. This inferred clock will be of unknownphase relationship to the sending clock and hence represent anadditional source of non-determinism.

As illustrated, the external interconnect 72 comprises an externalexchange block (XB) 78. The compiler nominates one of the tiles 4 tosend an external exchange request (XREQ) to the exchange block 78 (stepS1). The XREQ is a message comprising one or more control packets,indicating which of the tiles 4 have data packets (content) to send toanother tile or tiles 4 on another chip 2. This is illustratedschematically in FIG. 19 by the ticks and crosses: by way of an examplescenario, those labelled with a tick have data packets to sendexternally and those labelled with a cross do not. At step S2, Theexchange block 78 sends an exchange-on (XON) control packet to a firstof the tiles 4 with data to send externally. This causes the first tileto start sending its packets to the relevant destination via theexternal interconnect 78 (step S3). If at any time the XB is unable tocontinue sending packets to the interconnect (e.g. due to a previouspacket loss and re-transmission in the interconnect, or due toover-subscription of the external interconnect by many other XBs andtiles) the XB will send an exchange-off (XOFF) to that tile before theXBs queue overflows. Once the congestion is cleared and the XB again hassufficient space in its queue it will send an XON to the tile allowingit to continue transmitting its content. Once this tile has sent itslast data packet, then at step S4 the exchange block 78 sends anexchange-off (XOFF) control packet to this tile, then at step S5 sendsanother XON to the next tile 4 with data packets to send, and so forth.The signalling of XON and XOFF are implemented as a hardware mechanismin dedicated hardware logic in the form of the external exchange block78.

It will be appreciated that this is just one example of a flow controlmechanism for communicating external between chips. Other suitablemechanisms, in themselves, will be familiar to a person skilled in theart. Also, the possibility of a time-deterministic and/or queue-lessexternal interconnect is not excluded.

FIG. 15 illustrates an example application of the processor architecturedisclosed herein, namely an application to machine intelligence.

As will be familiar to a person skilled in the art of machineintelligence, machine intelligence begins with a learning stage wherethe machine intelligence algorithm learns a knowledge model. The modelcomprises a graph of interconnected nodes (i.e. vertices) 102 and edges(i.e. links) 104. Each node 102 in the graph has one or more input edgesand one or more output edges. Some of the input edges of some of thenodes 102 are the output edges of some others of the nodes, therebyconnecting together the nodes to form the graph.

Further, one or more of the input edges of one or more of the nodes 102form the inputs to the graph as a whole, and one or more of the outputedges of one or more of the nodes 102 form the outputs of the graph as awhole. Sometimes a given node may even have all of these: inputs to thegraph, outputs from the graph and connections to other nodes. Each edge104 communicates a value or more often a tensor (n-dimensional matrix),these forming the inputs and outputs provided to and from the nodes 102on their input and output edges respectively.

Each node 102 represents a function of its one or more inputs asreceived on its input edge or edges, with the result of this functionbeing the output(s) provided on the output edge or edges. Each functionis parameterized by one or more respective parameters (sometimesreferred to as weights, though they need not necessarily bemultiplicative weights). In general the functions represented by thedifferent nodes 102 may be different forms of function and/or may beparameterized by different parameters.

Further, each of the one or more parameters of each node's function ischaracterized by a respective error value. Moreover, a respectivecondition may be associated with the error(s) in the parameter(s) ofeach node 102. For a node 102 representing a function parameterized by asingle parameter, the condition may be a simple threshold, i.e. thecondition is satisfied if the error is within the specified thresholdbut not satisfied if the error is beyond the threshold. For a node 102parameterized by more than one respective parameter, the condition forthat node 102 having reached an acceptable level of error may be morecomplex. For example, the condition may be satisfied only if each of theparameters of that node 102 falls within respective threshold. Asanother example, a combined metric may be defined combining the errorsin the different parameters for the same node 102, and the condition maybe satisfied on condition that the value of the combined metric fallswithin a specified threshold, but otherwise the condition is notsatisfied if the value of the combined metric is beyond the threshold(or vice versa depending on the definition of the metric). Whatever thecondition, this gives a measure of whether the error in the parameter(s)of the node falls below a certain level or degree of acceptability. Ingeneral any suitable metric may be used. The condition or metric may bethe same for all nodes, or different for different respective ones ofthe nodes.

In the learning stage the algorithm receives experience data, i.e.multiple data points representing different possible combinations ofinputs to the graph. As more and more experience data is received, thealgorithm gradually tunes the parameters of the various nodes 102 in thegraph based on the experience data so as to try to minimize the errorsin the parameters. The goal is to find values of the parameters suchthat the output of the graph is as close as possible to a desired outputfor a given input. As the graph as a whole tends toward such a state,the graph is said to converge. After a suitable degree of convergencethe graph can then be used to perform predictions or inferences, i.e. topredict an outcome for some given input or infer a cause for some givenoutput.

The learning stage can take a number of different possible forms. Forinstance, in a supervised approach, the input experience data takes theform of training data, i.e. inputs which correspond to known outputs.With each data point, the algorithm can tune the parameters such thatthe output more closely matches the known output for the given input. Inthe subsequent prediction stage, the graph can then be used to map aninput query to an approximate predicted output (or vice versa if makingan inference). Other approaches are also possible. For instance, in anunsupervised approach, there is no concept of a reference result perinput datum, and instead the machine intelligence algorithm is left toidentify its own structure in the output data. Or in a reinforcementapproach, the algorithm tries out at least one possible output for eachdata point in the input experience data, and is told whether this outputis positive or negative (and potentially a degree to which it ispositive or negative), e.g. win or lose, or reward or punishment, orsuch like. Over many trials the algorithm can gradually tune theparameters of the graph to be able to predict inputs that will result ina positive outcome. The various approaches and algorithms for learning agraph will be known to a person skilled in the art of machine learning.

According to an exemplary application of the techniques disclosedherein, each worker thread is programmed to perform the computationsassociated with a respective individual one of the nodes 102 in amachine intelligence graph. In this case at least some of the edges 104between nodes 102 correspond to the exchanges of data between threads,and some may involve exchanges between tiles. Furthermore, theindividual exit states of the worker threads are used by the programmerto represent whether or not the respective node 102 has satisfied itsrespective condition for convergence of the parameter(s) of that node,i.e. has the error in the parameter or parameters fallen within theacceptable level or region in error space. For instance, this is oneexample use of the embodiments where each of the individual exit statesis an individual bit and the aggregated exit state is an AND of theindividual exit states (or equivalently an OR if 0 is taken to bepositive); or where the aggregated exit state is a trinary valuerepresenting whether the individual exit states were all true, all falseor mixed. Thus, by examining a single register value in the exit stateregister 38, the program can determine whether the graph as whole, or atleast a sub-region of the graph, has converged to an acceptable degree.

As another variant of this, embodiments may be used where theaggregation takes the form of a statistical aggregation of individualconfidence values. In this case each individual exit state represents aconfidence (e.g. as a percentage) that the parameters of the noderepresented by the respective thread have reached an acceptable degreeof error. The aggregated exit state can then be used to determine anoverall degree of confidence as to whether the graph, or a subregion ofthe graph, has converged to an acceptable degree.

In the case of a multi-tile arrangement 6, each tile runs a subgraph ofthe graph. Each subgraph comprises a supervisor subprogram comprisingone or more supervisor threads, and a set of worker threads in whichsome or all of the workers may take the form of codelets.

It will be appreciated that the above embodiments have been described byway of example only.

For instance, the concept of separating internal, time-deterministic andexternal, non-time deterministic BSP phases is not limited to beingimplemented through the use of the dedicated sync instruction of theabove-described embodiments. While this is particularly efficient, it isnot excluded that the internal-external BSP principle could instead beimplemented in code made up of general purpose machine codeinstructions.

Also, the scope of the present disclosure is not limited to thetime-deterministic domain being on-chip nor the non-time-deterministicexchange being specifically off-chip. It would also be possible to makethe divide between the time-deterministic and non-time-deterministicrealms in other ways. For instance it is not excluded to extend thetime-deterministic domain across multiple chips 2, with differentmulti-chip time deterministic domains being connected by anon-time-deterministic interconnect (e.g. the different multi-chiptime-deterministic domains being implemented on different cards orserver chassis). Or as another example, different time-deterministicdomains could be implemented on a given chip 2, with anon-time-deterministic on-chip interconnect being provided between suchdomains.

Further, the implementation of the time-deterministic domain is notlimited to use of an inter-tile delay look up table. Instead for examplean analytical formula could be used to determine the inter-tile delay.Further, the inter-tile delay and the send and receive timings are notlimited to being set by the compiler. E.g. alternatively they could bearranged manually by the programmer.

Further, the scope of the present disclosure is not limited by any oneparticular reason for making the split between the time-deterministicand non-time-deterministic realms. As discussed previously, there are anumber of potential drivers for this: queuing, lossy vs. losslesstransmissions, latency, and/or the on-chip/off-chip divide. In all suchcases or others, it may be desirable, at least in certain phases, toavoid that non-time-deterministic exchanges pollute the time-determinismof a -time deterministic exchange phase. The scope of the disclosure isnot limited by any one possible motivation.

Further, the applicability of the techniques disclosed herein is notlimited to the above-described architecture in which a separate contextis provided for the supervisor thread, or in which the supervisor threadruns in a slot and then relinquishes its slot to a worker. In anotherarrangement for example, the supervisor may run in its own dedicatedslot. Or the internal-external BSP concept may even be used in scenarioswhere one, some or all of the tiles on one, some or all of the chipsemploy non-multithreaded execution.

Where multithreaded tiles are used, the terms “supervisor” and “worker”do not necessarily have to imply specific responsibilities expect whereotherwise explicitly stated, and particularly are do not in themselvesnecessarily limit to the above-described scheme in which a supervisorthread relinquishes its time slot to a worker, and so forth. In general,worker thread may refer to any thread to which some computational taskis allocated. The supervisor may represent any kind of overseeing orcoordinating thread responsible for actions such as: assigning workersto barrel slots, and/or performing barrier synchronizations betweenmultiple threads, and/or performing any control-flow operation (such asa branch) in dependence on the outcome of more than one thread.

Where reference is made to a sequence of interleaved time slots, or thelike, this does not necessarily imply that the sequence referred tomakes up all possible or available slots. For instance, the sequence inquestion could be all possible slots or only those currently active. Itis not necessarily precluded that there may be other potential slotsthat are not currently included in the scheduled sequence.

The term tile as used herein does not necessarily limit to anyparticular topography or the like, and in general may refer to anymodular unit of processing resource comprising a processing unit 10 andcorresponding memory 11, in an array of like modules, typically on thesame chip (same die).

Furthermore, where reference is made herein to performing asynchronization or an aggregation between a group of tiles, or aplurality of tiles or the like, this does not necessarily have to referto all tile on the chip or all tiles in the system unless explicitlystated. E.g. the SYNC and EXIT instructions could be configured toperform the synchronization and aggregation only in relation to acertain subset of tiles 4 on a given chip and/or only a subset of chips2 in a given system; whilst some other tiles 4 on a given chip, and/orsome other chips in a given system, may not be involved in a given BSPgroup, and could even be being used for some completely separate set oftasks unrelated to the computation being performed by the group at hand.

Further, the above-described synchronization schemes do not exclude theinvolvement, in embodiments, of external resources other than multi-tileprocessors, e.g. a CPU processor such as the host processor, or even oneor more components that are not processors such as one or more networkcards, storage devices and/or FPGAs (e.g. to communicate globalsynchronization messages as packets over a wider interconnect ratherthan over dedicated wires used only for synchronization purpose). Forinstance, some tiles may elect to engage in data transfers with anexternal system where these transfers form the computational burden ofthat tile. In this case the transfers should be completed before thenext barrier. In some cases the exit state of the tile may depend on aresult of the communication with the external resource, and this theresource may vicariously influence the exit state.

Alternatively or additionally, resources other than multi-tileprocessors, e.g. the host or one or more FPGAs, could be incorporatedinto the synchronization network itself. That is to say, a sync signalsuch as a Sync_req is required from this/these additional resources inorder for the barrier synchronization to be satisfied and the tiles toproceed to the next exchange phase. Further, in embodiments theaggregated global exit state may include in the aggregation an exitstate of the external resource, e.g. from an FPGA.

Also, while certain modes of SYNC instruction have been described above,the scope of the present disclosure more generally is not limited tosuch modes. For instance, the list of modes given above is notnecessarily exhaustive. Or in other embodiments, the SYNC instructionmay have fewer modes, e.g. the SYNC need not support differenthierarchical levels of external sync, or need not distinguish betweenon-chip and inter-chip syncs (i.e. in an inter-tile mode, always acts inrelation to all tiles regardless of whether on chip or off chip). In yetfurther alternative embodiments, the SYNC instruction need not take amode as an operand at all. E.g. in embodiments separate versions of theSYNC instruction (different opcodes) may be provided for the differentlevels of synchronization and exit state aggregation (such as differentSYNC instructions for on-tile synchronization and inter-tile, on-chipsynchronization). Or in other embodiments, a dedicated SYNC instructionmay only be provided for inter-tile synchronizations (leaving on-tilesynchronization between threads, if required, to be performed in generalpurpose software).

In yet further variations, the SYNC instruction could take a greaternumber of possible modes to accommodate a greater granularity or rangeof hierarchical sync zones 91, 92; or simply a different set of modes toaccommodate different division of the system into hierarchical zones.For instance, as well as allowing selection between internal (on-chip)and external (off-chip) synchronization (or even as an alternative tothis), the modes of the SYNC instruction may be configured to recognizeother physical breakpoints further out beyond one chip (e.g. one ICpackage, one card, one box of cards etc.). Or even if no dedicated SYNCinstruction is used, such divisions may be implemented by the programmeror compiler using general purpose code. So in embodiments, one of thehierarchical sync zones (e.g. one of the modes of the SYNC instruction)may consist of all the tiles on all the chips on the same IC package(but none of the tiles or chips beyond that). Alternatively oradditionally, one of the hierarchical sync zones (e.g. again one of themodes of the SYNC instruction) may consist of all the tiles on all thechips on the same card (but none of the tiles, chips or packages beyondthat). As another alternative or additional example, one of thehierarchical sync zones (e.g. again another possible mode of the SYNCinstruction) may consist of all the tiles on all the chips on all thecards in the same physical box, e.g. same server chassis (but none ofthe tiles, chips or boxes beyond that). This would be advantageousbecause communication between different server chassis will tend toincur an even greater penalty than just between chips (dies) that arelocated within the same chassis.

Furthermore, the sync zones are not limited to being hierarchical (i.e.one nested in another), and in other embodiments the selectable synczones may consist of or include one or more non-hierarchical groups (alltiles of that group not nested within a single other selectable group).

Other applications and variants of the disclosed techniques may becomeapparent to a person skilled in the art once given the disclosureherein. The scope of the present disclosure is not limited by thedescribed embodiments but only by the accompanying claims.

What is claimed is:
 1. A method of operating a system comprisingmultiple processor tiles divided into a plurality of domains whereinwithin each domain the tiles are connected to one another via arespective instance of a time-deterministic interconnect and betweendomains the tiles are connected to one another via anon-time-deterministic interconnect; the method comprising: on eachrespective one of a participating group of some or all of the tilesacross the domains, performing a compute stage in which the respectivetile performs a respective one or more on-tile computations, butcommunicates computation results neither to nor from any others of thetiles in the group; within each respective one of said one or moredomains, performing a respective internal barrier synchronization torequire that all the participating tiles in the respective domain havecompleted the compute phase before any of the participating tiles in therespective domain is allowed to proceed to an internal exchange phase,thereby establishing a common time-reference between all participatingtiles internally within each individual one of said one or more domains;following the respective internal barrier synchronization, performingsaid internal exchange phase within each of said one or more domains, inwhich each participating tile within the respective domain communicatesone or more results of its respective computations to and/or from one ormore others of the participating tiles within the same domain via thetime-deterministic interconnect, but communicates computation resultsneither to nor from any others of said domains; performing an externalbarrier synchronization to require all the participating tiles of saiddomains to have completed the internal exchange phase before any of theparticipating tiles is allowed to proceed to an external exchange phase,thereby establishing a common time-reference between all participatingtiles across the domains; and following said external barriersynchronization, performing the external exchange phase in which one ormore of the participating tiles communicate one or more of saidcomputation results with another of the domains via thenon-time-deterministic interconnect.
 2. The method of claim 1, whereinthe communications via the non-time-deterministic interconnect arequeued, but the communications between tiles via the time-deterministicinterconnect are not queued.
 3. The method of claim 1, wherein over thetime-deterministic interconnect, the communication between each pair oftransmitting and receiving tile is performed by: transmitting a messagefrom the receiving tile, and controlling the receiving tile to listen toan address of the transmitting tile at a predetermined time intervalafter the transmission by the transmitting tile, wherein thepredetermined time interval is equal to a total predetermined delaybetween the transmitting and receiving tile, the time interval being setby a compiler having predetermined information on the delay.
 4. Themethod of claim 1, wherein: the time-deterministic interconnect islossless, whilst the non-time-deterministic interconnect is lossy at aphysical layer, transport layer or networking layer.
 5. The method ofclaim 1, wherein each of the domains is a different respective chip, thetime-deterministic interconnect being an internal on-chip interconnectand the non-time-deterministic interconnect is an external interconnectbetween the chips.
 6. The method of claim 1, wherein each of the domainscomprises multiple chips, the time-deterministic interconnect being anexternal lossless inter-chip interconnect and the non-time-deterministicinterconnect is an external lossy interconnect.
 7. The method of claim1, comprising performing a series of repeating iterations, eachcomprising a respective instance of the compute stage, followed by arespective instance of the internal barrier synchronization, followed bya respective instance of the internal exchange phase, followed by arespective instance of the external barrier synchronization, followed bya respective instance of the external exchange phase; where eachsuccessive iteration is not allowed to proceed until the externalbarrier synchronization of the immediately preceding iteration has beenperformed.
 8. The method of claim 1, comprising performing a sequence ofinstances of the compute phase each followed by a corresponding instanceof the internal exchange phase and then a corresponding instance of theinternal barrier synchronization, wherein the external barriersynchronization follows the last the compute phase in said sequence. 9.The method of claim 7, comprising performing a sequence of instances ofthe compute phase each followed by a corresponding instance of theinternal exchange phase and then a corresponding instance of theinternal barrier synchronization, wherein the external barriersynchronization follows the last the compute phase in said sequence;wherein each of one or more of said iterations comprises a respectivesequence of multiple instances of the compute phase each followed by acorresponding instance of the internal exchange phase and then acorresponding instance of the internal barrier synchronization, whereinthe respective external barrier synchronization follows the lastinstance of the compute phase in the respective sequence.
 10. The methodof claim 1, wherein each of the internal and external barriersynchronizations is performed by executing a synchronization instructioncomprising an opcode and an operand, wherein the operand specifies amode of the synchronization instruction as being either internal orexternal, and wherein the opcode, when executed, causes hardware logicin the time-deterministic interconnect to coordinate the performance ofthe internal barrier synchronization when the operand specifies theinternal mode, and causes hardware logic in the non-time-deterministicinterconnect to coordinate the performance of the external barriersynchronization when the operand specifies the external mode.
 11. Themethod of claim 1, comprising selecting one of plurality of predefinedzones as the participating tiles, each zone comprising a different setor subset of said multiple domains.
 12. The method of claim 11, whereinthe zones are hierarchical, with at least two lower level zones beingnested within at least one higher level zone.
 13. The method of claim10, comprising selecting one of plurality of predefined zones as theparticipating tiles, each zone comprising a different set or subset ofsaid multiple domains; wherein the operand of the synchronisationinstruction specifies which of a plurality of different possiblevariants of the external mode the external barrier synchronizationapplies to, each corresponding to a different one of said zones.
 14. Themethod of claim 13, wherein the zones are hierarchical, with at leasttwo lower level zones being nested within at least one higher levelzone; and wherein the variants of the external mode specify at leastwhich hierarchical level of zone the external barrier synchronizationapplies to.
 15. The method of claim 12, wherein the externalsynchronization and exchange comprises: first performing a first-levelexternal synchronization and then exchange constrained within a first,lower-level one of said hierarchical zones; and following the firstlevel synchronization and exchange, performing a second-level externalsynchronization and exchange across a second, higher level one of saidzones.
 16. The method of claim 11, wherein one of said hierarchicalzones consists of all tiles on in a same IC package, but none beyond;and/or one of said hierarchical zones consists of all tiles in a samecard, but none beyond; and/or one of said hierarchical zones consist ofall tiles in a same chassis, but none beyond.
 17. The method of claim 1,comprising executing an abstain instruction on one or some of the tiles,the opcode of the abstain instruction causing the tile or tiles on whichit is executed to be opted-out of said group.
 18. The method of claim 1,wherein in the external exchange phase, one or more of the participatingtiles also communicate one or more of said computation results with ahost processor via said external interconnect, the host processor beingimplemented on a separate host processor chip.
 19. The method of claim 1wherein, in the compute phase, some or all of the participating tileseach run a batch of worker threads in an interleaved manner, and theinternal barrier synchronization requires all the worker threads inevery batch to have exited.
 20. The method of claim 1, comprising usingthe system to perform a machine intelligence algorithm in which eachnode in a graph has one or more respective input vertices and one ormore respective output vertices with the input vertices of at least someof the nodes being the output vertices of at least some others of thenodes, each node comprising a respective function relating its outputvertices to its input vertices, with each respective function beingparameterized by one or more respective parameters, and each of therespective parameters having an associated error, such that the graphconverges toward a solution as the errors in some or all of theparameters reduce; wherein each of the tiles models a respective one ormore of the nodes in the graph.
 21. The method of claim 5, wherein inthe external exchange phase, one or more of the participating tiles alsocommunicate one or more of said computation results with a hostprocessor via said external interconnect, the host processor beingimplemented on a separate host processor chip; and wherein said chipsare Al accelerator chips assisting the host processor.
 22. At least onenon-transitory computer-readable storage having encoded thereon codeconfigured so as when executed on said tiles to perform operations inaccordance with claim
 1. 23. A system comprising multiple processortiles divided into a plurality of domains wherein within each domain thetiles are connected to one another via a respective instance of atime-deterministic interconnect and between domains the tiles areconnected to one another via a non-time-deterministic interconnect; thesystem being programmed to perform operations of: on each respective oneof a participating group of some or all of the tiles across the domains,performing a compute stage in which the respective tile performs arespective one or more on-tile computations, but communicatescomputation results neither to nor from any others of the tiles in thegroup; within each respective one of said one or more domains,performing a respective internal barrier synchronization to require thatall the participating tiles in the respective domain have completed thecompute phase before any of the participating tiles in the respectivedomain is allowed to proceed to an internal exchange phase, therebyestablishing a common time-reference between all participating tilesinternally within each individual one of said one or more domains;following the respective internal barrier synchronization, performingsaid internal exchange phase within each of said one or more domains, inwhich each participating tile within the respective domain communicatesone or more results of its respective computations to and/or from one ormore others of the participating tiles within the same domain via thetime-deterministic interconnect, but communicates computation resultsneither to nor from any others of said domains; performing an externalbarrier synchronization to require all the participating tiles of saiddomains to have completed the internal exchange phase before any of theparticipating tiles is allowed to proceed to an external exchange phase,thereby establishing a common time-reference between all participatingtiles across the domains; and following said external barriersynchronization, performing the external exchange phase in which one ormore of the participating tiles communicate one or more of saidcomputation results with another of the domains via thenon-time-deterministic interconnect.